- 博客(8)
- 收藏
- 关注
原创 c++ pat 乙级 ---1004 成绩排名
1004 成绩排名 (20 分)读入 n(>0)名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。输入格式:每个测试输入包含 1 个测试用例,格式为第 1 行:正整数 n第 2 行:第 1 个学生的姓名 学号 成绩第 3 行:第 2 个学生的姓名 学号 成绩 ... ... ...第 n+1 行:第 n 个学生的姓名 学号 成绩其中姓名和...
2018-10-21 22:16:47 135 1
原创 c++ 获取数组的长度
//获得数组的长度template<typename T>int count(T& x){ int s1 = sizeof(x); int s2 = sizeof(x[0]); int result = s1 / s2; return result;}
2018-10-21 21:44:38 1421
原创 c++ pat 乙级 -------1002 读入一个正整数 n,计算其各位数字之和,用汉语拼音写出和的每一位数字。
1002 写出这个数 (20 分)读入一个正整数 n,计算其各位数字之和,用汉语拼音写出和的每一位数字。输入格式:每个测试输入包含 1 个测试用例,即给出自然数 n 的值。这里保证 n 小于 10100。输出格式:在一行内输出 n 的各位数字之和的每一位,拼音数字间有 1 空格,但一行中最后一个拼音数字后没有空格。输入样例:1234567890987...
2018-10-21 18:23:48 15124 7
原创 c++ pat 乙级 --1001 害死人不偿命的(3n+1)猜想
1001 害死人不偿命的(3n+1)猜想 (15 分)卡拉兹(Callatz)猜想:对任何一个正整数 n,如果它是偶数,那么把它砍掉一半;如果它是奇数,那么把 (3n+1) 砍掉一半。这样一直反复砍下去,最后一定在某一步得到 n=1。卡拉兹在 1950 年的世界数学家大会上公布了这个猜想,传说当时耶鲁大学师生齐动员,拼命想证明这个貌似很傻很天真的命题,结果闹得学生们无心学业,一心只证 (3...
2018-10-21 16:38:32 231
原创 c++ 实例
#include "stdafx.h"#include <iostream>using namespace std;int main(){ int a; a = 4; cout<<a<<endl; return 0;}
2018-10-21 16:19:34 126
原创 C++ - 进阶 1002
This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the informa...
2018-10-03 18:02:21 2099
原创 C++ - 进阶 1001
Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input ...
2018-10-03 12:08:29 172
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人