URI / BEE CROWD 1075 - Remaining 2 Solution in C,C++,Python | URI - BEECROWD - BEE 1075 Solution in C,C++,Python
beecrowd | 1075
Remaining 2
Adapted by Neilor Tonin, URI Brazil
Timelimit: 1Adapted by Neilor Tonin, URI Brazil
Read an integer N. Print all numbers between 1 and 10000, which divided by N will give the rest = 2.
Input
The input is an integer N (N < 10000)
Output
Print all numbers between 1 and 10000, which divided by n will give the rest = 2, one per line.
Input Sample | Output Sample |
13 | 2 |
URI / BEE CROWD 1075 - Remaining 2 Solution in C,C++,Python | URI - BEECROWD - BEE 1075 Solution in C,C++,Python
Demonstration:
URI / BEE 1075 Solution in C :
URI / BEECROWD Online Judge 1075 Solve in C : |
#include<stdio.h>
int main()
{
int i,n;
scanf("%d",&n);
for(i=1;i<=10000;i++){
if(i%n==2){
printf("%d\n",i);
}
}
}
eafa
ReplyDelete