2017年7月24日

NYOJ题目242 计算球体积

摘要: 描述 根据输入的半径值,计算球的体积。 #include<stdio.h>#define PI 3.1415926int main(){double r;while(scanf("%lf",&r)!=EOF){double v;v=4.0*PI*r*r*r/3.0;printf("%.0f\n",v 阅读全文

posted @ 2017-07-24 15:02 残夜半梦 阅读(139) 评论(0) 推荐(0)

NYOJ 题目113

摘要: 描述: 编写一个程序实现将字符串中的所有"you"替换成"we" #include<stdio.h>#include<string.h>int main(){ char s[1005]; int a,b,n,i; while(gets(s)!=NULL)//gets能接收含空格的字符串 { a=st 阅读全文

posted @ 2017-07-24 08:49 残夜半梦 阅读(106) 评论(0) 推荐(0)

2017年7月23日

NYOJ 题目477 A+B Problem III

摘要: 题目描述: 求A+B是否与C相等。 #include<stdio.h>int main(){ int N; scanf("%d",&N); while(N--) { double a,b,c; scanf("%lf %lf %lf",&a,&b,&c); if(a+b-c>=-0.0001&&a+b 阅读全文

posted @ 2017-07-23 20:02 残夜半梦 阅读(113) 评论(0) 推荐(0)

NYOJ题目96 n-1位数

摘要: 题目描述: 已知w是一个大于10但不大于1000000的无符号整数,若w是n(n≥2)位的整数,则求出w的后n-1位的数。 #include<stdio.h>#include<math.h>int main(){ int M; scanf("%d",&M); while(M--) { long in 阅读全文

posted @ 2017-07-23 17:33 残夜半梦 阅读(130) 评论(0) 推荐(0)

NYOJ 题目94 cigarettes

摘要: 题目描述: Tom has many cigarettes. We hypothesized that he has n cigarettes and smokes them one by one keeping all the butts. Out of k > 1 butts he can ro 阅读全文

posted @ 2017-07-23 16:49 残夜半梦 阅读(110) 评论(0) 推荐(0)

NYOJ题目57 日期计算

摘要: 题目描述: 输入一个日期,格式如:2010 10 24 ,判断这一天是这一年中的第几天。 #include<stdio.h>int main(){int a,b=0,c,y,m,d,fib;scanf("%d",&a);while(a--){scanf("%d %d %d",&y,&m,&d);if 阅读全文

posted @ 2017-07-23 15:50 残夜半梦 阅读(101) 评论(0) 推荐(0)

NYOJ题目60 谁获得了最高奖学金

摘要: 描述 某校的惯例是在每学期的期末考试之后发放奖学金。发放的奖学金共有五种,获取的条件各自不同: 1) 院士奖学金,每人8000元,期末平均成绩高于80分(>80),并且在本学期内发表1篇或1篇以上论文的学生均可获得; 2) 五四奖学金,每人4000元,期末平均成绩高于85分(>85),并且班级评议成 阅读全文

posted @ 2017-07-23 11:25 残夜半梦 阅读(154) 评论(0) 推荐(0)

NYOJ 题目56 阶乘式因式分解(一)

摘要: 题目描述: 给定两个数m,n,其中m是一个素数。 将n(0<=n<=10000)的阶乘分解质因数,求其中有多少个m。 #include<stdio.h>int main(){ int s,k; scanf("%d",&s); while(s--) { int m,n,i,b; scanf("%d % 阅读全文

posted @ 2017-07-23 08:59 残夜半梦 阅读(125) 评论(0) 推荐(0)

2017年7月22日

NYOJ 鸡兔同笼

摘要: 题目描述: 已知鸡和兔的总数量为n,总腿数为m。输入n和m,依次输出鸡和兔的数目,如果无解,则输出“No answer”(不要引号)。 #include<stdio.h>int main(){ int a; scanf("%d",&a); while(a--) { int n,m; scanf("% 阅读全文

posted @ 2017-07-22 20:04 残夜半梦 阅读(176) 评论(0) 推荐(0)

NYOJ题目22 素数求和

摘要: 题目描述: 现在给你N个数(0<N<1000),现在要求你写出一个程序,找出这N个数中的所有素数,并求和。输入第一行给出整数M(0<M<10)代表多少组测试数据每组测试数据第一行给你N,代表该组测试数据的数量。接下来的N个数为要测试的数据,每个数小于1000输出每组测试数据结果占一行,输出给出的测试 阅读全文

posted @ 2017-07-22 16:44 残夜半梦 阅读(129) 评论(3) 推荐(0)

导航