杭电acm1000

#include<stdio.h>
main()
{
  int a,b;
  while(scanf("%d%d",&a,&b)!=EOF)
  printf("%d\n",a+b);
      }

//通过代码

代码原型

#incldue<stdio.h>

main()

{

   int a,b;

scanf("%d%d",&a,&b);

printf("%d",a+b);

}

与原代码相比通过代码多了“ while(scanf("%d%d",&a,&b)!=EOF)”

作用是能够进行多次a+b运算。

posted on 2015-06-06 09:30  何处寻你  阅读(211)  评论(0编辑  收藏  举报

导航