Search found 2 matches

by partha31
Fri Aug 15, 2014 12:07 am
Forum: Volume 107 (10700-10799)
Topic: 10784 - Diagonal
Replies: 27
Views: 19144

Re: 10784 - Diagonals

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
double N,c=0;
while(cin>>N)
{
if(N==0)
break;
c++;
int n=(3+sqrt(9+8*N))/2;
if(((n*n)-3*n)/2<N)
n=n+1;
cout<<"Case "<<c<<": "<< n<<endl;
}
return 0;
}
what is the problem here???
by partha31
Tue Jun 10, 2014 11:26 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 84581

Re: UVA 10070

#include<stdio.h>
int main()
{
int n,a,b,c,count;
while(scanf("%d",&n)==1)
{
b==0;
count=0;
if(n%4==0&&n%100!=0||n%400==0)
{
printf("This is leap year.\n");
b++;
count++;
}
if(n%15==0)
{
printf("This is huluculu festival year.\n");
count++;
}
if(n%55==0&&b==1)
{
printf("This is ...

Go to advanced search