#include<stdio.h> #include<math.h> #include<stdlib.h> int main(){ int a,b,sum; while(scanf("%d%d",&a,&b)!=EOF){ if(a>b){ temp=a; a=b; b=temp; } sum=0; for(int i=a+1;i<b;i++) { int k=0; for(int j=2;j<=sqrt(i);j++){ if(i%j==0){k=1;break;} } if(k==0)sum+=i; } printf("%d\n",sum); } } /* Main.c: In function 'main': Main.c:11:4: error: 'temp' undeclared (first use in this function) temp=a; ^ Main.c:11:4: note: each undeclared identifier is reported only once for each function it appears in */ |
Double click to view unformatted code.