Month: August 2012

Uva 11530 – SMS Typing

Problem Link

Solution :-

Posted by Shipu Ahamed in Programming, Uva, 0 comments

Uva 10970 – Big Chocolate

Problem:-http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1911 



Solution :-

#include<stdio.h>
int main()
{
int m,n,c;
while(scanf(“%d%d”,&m,&n)==2)
printf(“%dn”,m*n-1);
return 0;
}

At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Programming, Uva, 0 comments

Uva 575 – Skew Binary


Solution :-

#include<stdio.h>#include<math.h>#include<string.h>int main(){long int l,i,s,c;char a[100];while(scanf(“%s”,&a)){s=0;l=strlen(a);for(i=0;i<l;i++){c=a[i]-‘0’;s+=c*(pow(2,l-i)-1);}if(s==0)break;printf(“%ldn”,s);}return 0;}
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Programming, Uva, 0 comments

Uva 10370 – Above Average

Solution :-

#include<stdio.h> 
int main()
{
int a[1020],i,c,d,e,m;
float w,k,n,j;
while( scanf(“%d”,&c)==1)
{
for(d=1;d<=c; d++)
{
w=0;
e=0;
k=0;
scanf(“%f”,&j);
for(i=0;i<j;i++)
{
scanf(“%d”,&a[i]);
k=k+a[i];
}
w=k/j;
for(m=0;m<j;m++)
{
if(a[m]>w)e=e+1;
}
n=(100*e)/j;
printf(“%.3f%%n”,n);
}
}
return 0;
}

At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Programming, Uva, 0 comments

Uva 10346 – Peter’s Smokes

Solution :-

#include<stdio.h>
int main()
{
int a,n,k;
while(scanf(“%d %d”,&n,&k)==2 && k>1)
{
a=n;
while(n>=k)
{
a=a+(n/k);
n=(n/k)+(n%k);
}
printf(“%dn”,a);
}
return 0;
}
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Programming, Uva, 0 comments

Uva 10110 – Light, more light

Problem Link

Solution :-

Posted by Shipu Ahamed in Programming, Uva, 0 comments

Uva 100 – The 3n + 1

Problem Link

Solution :-


 

Posted by Shipu Ahamed in Programming, Uva, 4 comments

Uva 10079 – Pizza Cutting

Solution :-

 

Posted by Shipu Ahamed in Programming, Uva, 0 comments