1. next_permutation

    产生全排列:

    2018/01/28 C

  2. fill和memset

    fill函数

    2018/01/28 C

  3. C++内存管理

    C 内存管理 这些函数可以在 <stdlib.h>头文件中找到。

    2018/01/28 C

  4. C++ 文件和流

    打开文件 在从文件读取信息或者向文件写入信息之前,必须先打开文件。ofstream 和 fstream 对象都可以用来打开文件进行写操作,如果只需要打开文件进行读操作,则使用 ifstream 对象。

    2018/01/28 C

  5. PAT甲题 1013. Battle Over Cities (25)

    Battle Over Cities (25)

    2018/01/28 PAT

  6. PAT甲题 1003. Emergency (25)

    Emergency (25)

    2018/01/28 PAT

  7. PAT乙题 1034. 有理数四则运算(20)

    费劲 ```c++ #include #include #include #include #include #include #include using namespace std; void trunc(long long a, long long b) { if (a%b == 0) { if (a <0) { printf("(%lld)", a / b); } else { printf("%lld", a / b); } } else { //cout << a << " " << b << endl; if (abs(a) > abs(b)) { //cout << a / b << " " << a % b << b << endl; if (a < 0) { printf("(%lld %lld/%lld)", (a / b), (abs(a) % b), b); } else { printf("%lld %lld/%lld", (a / b), (a%b), b);

    2018/01/27 PAT

  8. PAT乙题 1033. 旧键盘打字(20)

    #include <iostream> #include <algorithm> #include<math.h> #include<string> #include<vector> #include<ctype.h> #include<set> using namespace std; int main() { #ifdef LOCAL freopen("D:\\datain.txt", "r", stdin); #endif set<char> s; string str; getline(cin,str); for (int i = 0; i < str.length(); i++) { s.insert(str[i]); } string str1; cin >> str1; for (int i = 0; i < str1.length(); i++) { if (s.find(toupper(str1[i])) == s.end()) { if (isupper(str1[i])&&s.find('+') != s.end()) { //printf("%c", tolower(str1[i])); } else { printf("%c", str1[i]); } } } cout << endl; }

    2018/01/27 PAT

  9. PAT甲题 1002. A+B for Polynomials (25)

    #include <iostream> using namespace std; int main() { float c[1001] = { 0 }; int m, n, t; float num; scanf("%d", &m); for (int i = 0; i < m; i++) { scanf("%d%f", &t, &num); c[t] += num; } scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d%f", &t, &num); c[t] += num; } int cnt = 0; for (int i = 0; i < 1001; i++) { if (c[i] != 0) cnt++; } printf("%d", cnt); for (int i = 1000; i >= 0; i--) { if (c[i] != 0.0) printf(" %d %.1f", i, c[i]); } return 0; }

    2018/01/27 PAT

  10. c++重载

    函数重载 在同一个作用域内,可以声明几个功能类似的同名函数,但是这些同名函数的形式参数(指参数的个数、类型或者顺序)必须不同。您不能仅通过返回类型的不同来重载函数。

    2018/01/26 C