andmej / acm

My solutions for problems from the UVa Online Judge (Valladolid).

This URL has Read+Write access

acm / 10110 - Light, more light / 10110-2.cpp
100755 30 lines (22 sloc) 0.388 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
 
int main()
 
{
   unsigned int num,i,j;
   char step;
 
   scanf("%d",&num);
 
   while (num!=0)
   {
      step=0;
      i=4;
      j=5;
 
      while (num>i && i>0)
      {
         i+=j;
         j+=2;
      }
 
      if (num==i) printf("yes\n");
      else printf("no\n");
      scanf("%d",&num);
   }
 
   return 0;
}