View Code of Problem 112

#include <stdio.h>
int main()
{
  int N;
 while(scanf("%d ",%N)!=EOF)
 {
   if(N=0)
     break;
   else
   {
     int a,b,c;
     scanf("%d %d %d ",&a,&b,&c);
     printf("%d",a+b+c);
   }
 }
}
/*
Main.c: In function 'main':
Main.c:5:20: error: expected expression before '%' token
  while(scanf("%d ",%N)!=EOF)
                    ^
Main.c:7:4: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    if(N=0)
    ^
*/

Double click to view unformatted code.


Back to problem 112