C 语言实例 - 输出整数

C 语言教程 · 2019-02-20 13:27:57

使用 printf()%d 格式化输出整数。

实例

#include <stdio.h> int main() { int number; // printf() 输出字符串 printf("输入一个整数: "); // scanf() 格式化输入 scanf("%d", &number); // printf() 显示格式化输入 printf("你输入的整数是: %d", number); return 0; }

输出结果:

输入一个整数: 45
你输入的整数是: 45

点击查看所有 C 语言教程 文章: https://www.codercto.com/courses/l/17.html

查看所有标签

Squid: The Definitive Guide

Squid: The Definitive Guide

Duane Wessels / O'Reilly Media / 2004 / $44.95 US, $65.95 CA, £31.95 UK

Squid is the most popular Web caching software in use today, and it works on a variety of platforms including Linux, FreeBSD, and Windows. Squid improves network performance by reducing the amount of......一起来看看 《Squid: The Definitive Guide》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换