C语言基本操作

有哪位高手能告诉我一个C语言的标准程序的输入和输出,我现在对以前所学的知识都忘记了,程序的开始和结尾的定义语句以及输入输出的格式,谢谢大家了!!!!!

标准输入输出应加头文件其预处理命令为
#include<stdio.h>(是C的编译器的话可以不加)
printf(格式控制,输出列表)如:
pritnf("%d,%c\n",a,b)
函数原型 int printf(char *format,arg,……)

scanf(格式控制,输出列表)如:
scanf("%d,%c\n",&a,&b)
函数原型 int scanf(char *format,arg,……)

其他常用的标准输入输函数如getchar,gets,putchar,puts等在这里就不具体说明了
请参看C库函数(C语言的书上都有)

参考资料:谭浩强著.C程序设计(第三版)

温馨提示:答案为网友推荐,仅供参考
第1个回答  2006-03-09
#include<stdio.h>
void main()
{
int a;
scanf("%d",&a);
printf("%d\n",a);
}
这就是你虚要的最简单的程序!~
scanf是输入
Printf是输出
第2个回答  2006-03-09
#include<头文件>
{
printf("hello world\n");
scanf("数据类型%",&输入的变量名);
}
第3个回答  2006-03-09
#include<stdio.h>
main()
{
printf("hello world\n");
scanf("数据类型%",&输入的变量名);
}
第4个回答  2006-03-09
#include"stdio.h"
main()
{int()
printf();)
相似回答