UVA-12403 (Save Setu)
#include<stdio.h>
int main()
{
char s[100];
int a,sum=0,n;
scanf("%d",&n);
while(0<n)
{
scanf("%s",s);
if(strcmp(s,"donate")==0)
{
scanf("%d",&a);
sum=sum+a;
}
else
{
printf("%d\n",sum);
}
n--;
}
return 0;
}
100 - The 3n + 1 problemTime limit: 3.000 seconds The 3n + 1 problem Background Problems in Computer Science are often classified as belon...
UVA-382–Perfection- Using java 382 - PerfectionTime limit: 3.000 seconds Perfection From the article Number Theory in the 1994 Microsoft Encarta: `...
136 - Ugly Numbers Ugly Numbers Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15,...
11479 - Is this the easiest problem A triangle is a geometric shape with three positive sides. However, any given three sides won't neces-sarily form...
<?php // Start the session session_start(); ?> <!DOCTYPE html> <html> <head> <link rel=...
No comments:
Post a Comment