
C语言
粥游
这个作者很懒,什么都没留下…
展开
-
杭电ACM 2000 ASCII码排序-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2000#include <stdio.h>int main(){ char a[3],temp; int i,j; while(scanf("%s",&a)!=EOF){ for(i=0;i<3;i++){ for(j=0;j+1<3-i...原创 2019-02-23 15:16:25 · 341 阅读 · 0 评论 -
杭电ACM 2014 青年歌手大奖赛_评委会打分-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2014#include <stdio.h>int main(){ int n,a,h,l,i; double s=0; while(scanf("%d",&n)!=EOF){ for(i=0;i<n;i++){ scanf("%d",&a); s+=...原创 2019-02-24 20:26:32 · 733 阅读 · 0 评论 -
杭电ACM 2013 蟠桃记-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2013#include <stdio.h>int main(){ int n,i,num=1; while(scanf("%d",&n)!=EOF){ for(i=1;i<n;i++){ num=(num+1)*2; } printf("%d\n",num)...原创 2019-02-24 20:04:22 · 1361 阅读 · 0 评论 -
杭电ACM 2012 素数判定-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2012#include <stdio.h>int main(){ int x,y,i,j,num,flag; while(scanf("%d %d",&x,&y)&&(x!=0||y!=0)) { flag=1; for(i=x;i<=y&a...原创 2019-02-24 19:48:35 · 1841 阅读 · 0 评论 -
杭电ACM 2011 多项式求和-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2011#include <stdio.h>int main(){ int m,n,i,j,tmp; double num; while(scanf("%d",&m)!=EOF){ for(i=0;i<m;i++){ scanf("%d",&n); n...原创 2019-02-24 19:21:35 · 727 阅读 · 0 评论 -
杭电ACM 2010 水仙花数-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2010#include <stdio.h>int main(){ int m,n,i,a,b,c,flag=0; while(scanf("%d %d",&m,&n)!=EOF){ for(i=m;i<=n;i++){ a=i%10; b=i/100;...原创 2019-02-24 19:02:51 · 1305 阅读 · 0 评论 -
杭电ACM 2009 求数列的和-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2009#include <stdio.h>#include <math.h>int main(){ int m,n,i; double sq,t; while(scanf("%d %d",&n,&m)!=EOF){ t=n; for(i=0;i<...原创 2019-02-23 15:35:08 · 431 阅读 · 0 评论 -
杭电ACM 2008 数值统计-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2008#include <stdio.h>int main(){ int n,i,a=0,b=0,c=0; double num; while(scanf("%d",&n)!=EOF){ if(n!=0){ for(i=0;i<n;i++){ scanf(...原创 2019-02-23 15:33:27 · 506 阅读 · 0 评论 -
杭电ACM 2007 平方和与立方和-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2007#include <stdio.h>int main(){ int m,n,t,x=0,y=0,i; while(scanf("%d %d",&m,&n)!=EOF){ if(m>n){t=m;m=n;n=t;} for(i=...原创 2019-02-23 15:32:09 · 1485 阅读 · 3 评论 -
杭电ACM 2006 求奇数的乘积-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2006#include <stdio.h>int main(){ int n,i,num,mul=1; while(scanf("%d",&n)!=EOF){ for(i=0;i<n;i++){ scanf("%d",&num); if(num%2!=...原创 2019-02-23 15:31:12 · 576 阅读 · 0 评论 -
杭电ACM 2005 第几天?-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2005#include <stdio.h>int main(){ int year,month,day,i,num=0; int d[12]={31,28,31,30,31,30,31,31,30,31,30,31}; while(scanf("%d/%d/%d",&year,&...原创 2019-02-23 15:30:10 · 838 阅读 · 1 评论 -
杭电ACM 2004 成绩转换-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2004#include <stdio.h>int main(){ int t; while(scanf("%d",&t)!=EOF){ /* if(t>=90&&t<=100) printf("A"); else if (t>...原创 2019-02-23 15:23:10 · 425 阅读 · 0 评论 -
杭电ACM 2003 求绝对值-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2003#include <stdio.h>#include <math.h>int main(){ double num,temp; while(scanf("%lf",&num)!=EOF){ printf("%.2lf\n",fabs(num)); /...原创 2019-02-23 15:21:47 · 255 阅读 · 0 评论 -
杭电ACM 2002 计算球体积-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2002#include <stdio.h>#define PI 3.1415927int main(){ double r,temp; while(scanf("%lf",&r)!=EOF){ temp=4.0/3*PI*r*r*r; printf("%.3lf\...原创 2019-02-23 15:20:23 · 335 阅读 · 0 评论 -
杭电ACM 2001 计算两点间距离-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2001#include <stdio.h>#include <math.h> int main(){ double x1,y1,x2,y2,temp; while(scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2...原创 2019-02-23 15:17:29 · 591 阅读 · 0 评论 -
杭电ACM 2015 偶数求和-C语言
http://acm.hdu.edu.cn/showproblem.php?pid=2015#include <stdio.h>int main(){ int n,m,i,j,num=0,s; while(scanf("%d %d",&n,&m)!=EOF){ for(i=0;i<n/m;i++){ s=0; for(j=0;j<...原创 2019-02-24 22:10:38 · 1800 阅读 · 4 评论