(已解决)请教一下,scanf前面的~是什么意思啊?
这是我写的代码
#include <stdio.h>
int main()
{
int a,b;
while(scanf("%d %d", &a, &b)) printf("%d", a+b);
return 0;
}
然后这是做题目正确的答案
#include<stdio.h>
int main()
{
int a,b;
while(~scanf("%d%d", &a, &b))printf("%d\n",a+b);
return 0;
}
它就多了一个这个~,我不知道是什么意思咧,有没有大神能教一下!
推荐文章: