a+b用C怎么写?Sample Input 1 5 Sample Output 6补充用GCC编译:gcc 1.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGEG:\Program Files\gcc\bin>gcc.exe G:\1.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGEG:\1.c:In func

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 00:26:16
a+b用C怎么写?Sample Input 1 5 Sample Output 6补充用GCC编译:gcc 1.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGEG:\Program Files\gcc\bin>gcc.exe G:\1.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGEG:\1.c:In func

a+b用C怎么写?Sample Input 1 5 Sample Output 6补充用GCC编译:gcc 1.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGEG:\Program Files\gcc\bin>gcc.exe G:\1.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGEG:\1.c:In func
a+b用C怎么写?
Sample Input
1 5
Sample Output
6
补充用GCC编译:gcc 1.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGE
G:\Program Files\gcc\bin>gcc.exe G:\1.c -o foo -ansi -fno-asm -O2 -Wall -lm --st
atic -DONLINE_JUDGE
G:\1.c:In function 'main':
G:\1.c:6:warning:control reaches end of non-void function
2楼的就是这样
G:\1.c:In function 'main':
G:\1.c:5:error:stray '\243' in program
G:\1.c:5:error:stray '\241' in program
G:\1.c:5:error:lvalue required as left operand of assignment
3楼的
G:\1.c:3:warning:return type of 'main' is not 'int'
4楼

a+b用C怎么写?Sample Input 1 5 Sample Output 6补充用GCC编译:gcc 1.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGEG:\Program Files\gcc\bin>gcc.exe G:\1.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGEG:\1.c:In func
#include
int main(){
int a,b;
while(scanf("%d%d",&a,&b)==2) /* 多组数据测试 */
printf("%d\n",a + b);
return 0;
}
一些竞赛要求能多组数据测试