Coder

舒心、快乐,比什么都重要

摘要: #include #include #include using namespace std; int main(){ double sum4 = 0.0; int n, t, k = -1, cnt = 0, cnt2 = 0, max = 0, sum1 = 0, sum2 = 0, sum3 = 0; cin >> n; while (n--){ ... 阅读全文
posted @ 2019-04-16 22:53 H123K 阅读(172) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main(){ int t; cin >> t; double a, b, c; // 因为int最大是2^31的数字,所以要用double 这个很重要 for (int i = 1; i > a >> b >> c; if (a + b > c) c... 阅读全文
posted @ 2019-04-16 21:53 H123K 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main(){ stacks; string str, stu = ""; //制造空字符串 getline(cin, str); for (int i = 0; i < str.size(); i++) { // 通过间接法将一个字符串转入另一个字... 阅读全文
posted @ 2019-04-16 21:26 H123K 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main(){ int n, m; cin >> n >> m; int *p = new int[n]; for (int i = 0; i > p[i]; m = m % n; reverse(p, p + n - m); // 算法... 阅读全文
posted @ 2019-04-16 01:41 H123K 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 第一个方法: #include #include using namespace std; int main(){ int n, h, t, o; cin >> n; h = n / 100; // 对于每位数的求解不能出错 t = n / 10 % 10; o = n % 100 % 10; if (h != 0){ // 要使用连续的是那... 阅读全文
posted @ 2019-04-16 00:32 H123K 阅读(181) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; struct Stu { int score; string id, num; }stu; int main(){ string s1 ,s2 , s3, s4; int n, max = 0, min = 110; cin >> n; while (n--) { cin... 阅读全文
posted @ 2019-04-16 00:03 H123K 阅读(106) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main(){ int sum = 0; string num; stacknumber; string str[10] = {"ling", "yi", "er", "san", "si", "wu", "liu", "qi", "ba", "jiu"}... 阅读全文
posted @ 2019-04-15 21:05 H123K 阅读(115) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main(){ int n, count = 0; cin >> n; while (n != 1){ if (n % 2 != 0) n = (3 * n + 1) / 2; else n /= 2; co... 阅读全文
posted @ 2019-04-15 18:50 H123K 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int baoshi[10500]; //数组要开的大一点儿不然一直wa; int main(){ int t, n, a, b, i, cnt, count, k = 1; cin >> t; while (t--){ count = 0; memset(b... 阅读全文
posted @ 2019-04-15 18:39 H123K 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 int main(){ 4 int t, n, m, x, tmp = 0;; 5 cin >> t; 6 while (t--){ 7 cin >> n >> m; 8 for (int i = 0; i 阅读全文
posted @ 2019-04-15 12:04 H123K 阅读(144) 评论(0) 推荐(0) 编辑