1072 - Interval 2
A Solution in c
int main()
{
int t, i, in = 0, out = 0, n;
scanf("%d", &t);
for(i = 0; i < t; i++)
{
scanf("%d", &n);
if(n >= 10 && n <= 20)in++;
else out++;
}
printf("%d in\n%d out\n", in, out);
return 0;
}
Lakshman |
My name is Lakshman Gope. I'm a problem solver and a blogger. Now I am a student at Daffodil International University Department of Software Engineering. I like to learn algorithms and write clean code in an efficient and optimized way. I've been working on c, c++ and Java for a year and a half continuously.
No comments