#include<stdio.h> int main() { long int i=0,j=0; int k long int a[1000]; while(scanf("%d",&k)){ for(i=0;i<1000;i++){ if(i%3==2&&i%5==3&&i%7==2){ a[j++]=i; } } printf("%ld\n",a[k-1]); } } /* Main.c: In function 'main': Main.c:5:10: error: expected ';' before 'long' int k ^ ; long int a[1000]; ~~~~ Main.c:8:23: error: 'k' undeclared (first use in this function) while(scanf("%d",&k)){ ^ Main.c:8:23: note: each undeclared identifier is reported only once for each function it appears in Main.c:6:14: warning: variable 'a' set but not used [-Wunused-but-set-variable] long int a[1000]; ^ */ |
Double click to view unformatted code.