Getting Started
黯淡蓝点
这个作者很懒,什么都没留下…
展开
-
UVA - 490 - Rotating Sentences
#include #include #include int main() { char a[101][101]; int i,j,k=0,q=0; while((fgets(a[k++],100,stdin))!=NULL); for(i=0;i<k;i++) { if(strlen(a[i])>q)原创 2012-08-21 23:17:09 · 250 阅读 · 0 评论 -
UVA - 694 - The Collatz Sequence
#include long count=0; long Collatz(long a,long limit) { long i,j; if(a==1)return ++count; if(a%2==0) { a=a/2; count++; Collatz(a,limit); } else原创 2012-08-21 23:21:45 · 201 阅读 · 0 评论 -
UVA - 489 - Hangman Judge
#include #include /*猜测过的字符无论对错 绝不再判断 而且必须尽可能早的得出结果, 也就是尽量在扫描完guess串之前得出结论, 此点特别容易错!*/ int contest(char a[],char b[]) { int count=0,i,j,k,flag[50]={0},guess[50]={0},stroke=0,f=0; for(i原创 2012-08-21 23:20:34 · 289 阅读 · 0 评论 -
UVA - 488 - Triangle Wave
#include int main() { int n,amp,fre,i,j,k,s,flag=0; scanf("%d",&n); for(s=0;s<n;s++) { scanf("%d %d",&,&fre); for(i=0;i<fre;i++) { for(j=1;j<=amp*2;j原创 2012-08-21 23:19:29 · 388 阅读 · 0 评论 -
UVA - 445 - Marvelous Mazes
#include #include #include int main() { char c; int count=0,i; while((c=getchar())!=EOF) { if(isdigit(c)) { count+=c-48; } else if(c=='!'||c原创 2012-08-21 23:18:33 · 224 阅读 · 0 评论 -
UVA - 414 - Machined Surfaces
#include #include int main() { int n,i,j,k[13],sum=0,count=0,min=26; char a[13][30]; while(scanf("%d",&n)!=EOF&&n) { getchar(); for(i=0;i<n;i++) { g原创 2012-08-21 23:16:24 · 232 阅读 · 0 评论 -
UVA - 494 - Kindergarten Counting Game
#include #include int main() { char c; int flag=1,count=0; while((c=getchar())!=EOF) { if(isalpha(c)) { if(flag) { count++;原创 2012-08-21 23:15:29 · 209 阅读 · 0 评论 -
UVA - 458 - The Decoder
#include int main() { char c; while(scanf("%c",&c)!=EOF) { if(c!='\n')putchar(c-7); else putchar('\n'); } return 0; }原创 2012-08-21 23:14:39 · 229 阅读 · 0 评论 -
UVA - 10300 - Ecological Premium
#include int main() { int n,f,farmyard[20],animal[20],ef[20],i,j,value=0; while(scanf("%d",&n)!=EOF) { for(j=0;j<n;j++) { scanf("%d",&f); for(i=0;i<f;i++)原创 2012-08-21 23:13:34 · 204 阅读 · 0 评论 -
UVA - 10071 - Back to High School Physics
直接套公式即可。 #include int main() { int v,t,d=0; while((scanf("%d%d",&v,&t))!=EOF) { printf("%d\n",v*t*2); } return 0; }原创 2012-08-21 23:10:32 · 214 阅读 · 0 评论 -
UVA - 10055 - Hashmat the Brave Warrior
#include void Print(long long a) { if(a<0)printf("%ld\n",-a); else printf("%ld\n",a); } int main() { long Hashmet,Opponent,d=0; while((scanf("%ld%ld",&Hashmet,&Opponent))!=EOF)原创 2012-08-21 23:07:56 · 226 阅读 · 0 评论 -
UVA - 457 - Linear Cellular Automata
#include void Produce(int a[][45],int b[]) { int i,j,k,dup; a[1][20]=1; for(i=2;i<=50;i++) { for(j=1;j<=40;j++) { k=a[i-1][j-1]+a[i-1][j]+a[i-1][j+1];原创 2012-08-21 23:22:49 · 245 阅读 · 0 评论