1 solutions
-
0
C :
#include<stdio.h> int main() { int a,b,t; while(scanf("%d%d",&a,&b)!=EOF) { if(a>b) { t=a;a=b;b=t;} int i,x,count=0; for(i=a;i<=b;i++) { if(i>=100) x=i%100; else if(i<100) x=i; if(x==31) { printf("%d\n",i); count++; } } if(count==0) printf("NONE\n"); } return 0; }C++ :
#include<stdio.h> int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int a,b; while(scanf("%d%d",&a,&b)!=EOF) { int tmp; if(a>b) { tmp=a; a=b; b=tmp; } int flag=0; for(int i=a; i<=b; i++) { if(flag==0) { int j=i; int c=j%10; j/=10; int d=j%10; if(c==1&&d==3) { flag=1; printf("%d\n",i); i+=99; } } else { printf("%d\n",i); i+=99; } } if(!flag) printf("NONE\n"); } return 0; }
- 1
Information
- ID
- 20158
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By