Advertisement
noshin98

uva 10784

Jul 15th, 2016
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5.     long long n,t,x;
  6.     t=1;
  7.     while(scanf("%lld",&n)==1)
  8.     {
  9.         if(n==0)
  10.             break;
  11.         x=ceil((3+sqrt(9+8*n))/2);
  12.         printf("Case %lld: %lld\n",t++,x);
  13.     }
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement