include<stdio.h>
int main()
{
return 0;
}
问题:
- return 0 位置写错
- 拼写错误
- printf("%d %d",a,b) ;
scanf("%d%d", &a,&b);//注意地址符 - 数据类型 8/3
- if(1==a)//后面没有符号
else()
else if() - switch(a)
{
case 2+7 ;break;
} - while()
{
}
do
{
}while();
for(;;)
{
} - 数组
int a[1]//不能写0 必须是大于
char str[100]="hello";
str="word";//不能这么写 常量不能被赋值
str[0]='w';
str[1]='o'
char str1[6]='hello';
char str2[10]='world';
if(strcmp(str1,str2)==0) - 指针
int *p;
int a ;
p=&a;
*p=5; - 宏定义
define N 100
原样替换 优先级导致的计算问题
- 结构体
structs stu A[100];
A[7].a;
多组输入
int a,b;
while(scanf("%d%d",&a,&b)==2)//scanf 返回值:成功接收数值的位数//while 判断Scanf返回值是否为2;
while(scanf("%d%d",&a,&b)!=EOF)
{
printf("%d\n",a+b);
}
网友评论