#include<stdio.h>
int main()
{
int a,b;
while(~scanf("%d",&a,&b))
printf("%d",a+b);
return 0;
}
显而易见 scanf的格式除了严重的错误,少了一个%d,但是调皮的c语言会出现这样一个效果
你输入两个数,会原样个位十位加1 这样的效果出人意料 不是吗
输入 1 2
输出 23
输入2 3
输出 34
#include<stdio.h>
int main()
{
int a,b;
while(~scanf("%d",&a,&b))
printf("%d",a+b);
return 0;
}
显而易见 scanf的格式除了严重的错误,少了一个%d,但是调皮的c语言会出现这样一个效果
你输入两个数,会原样个位十位加1 这样的效果出人意料 不是吗
输入 1 2
输出 23
输入2 3
输出 34