6161 分鐘

// 1 2 3 4 5 6 7 8 9 1 2 3 4 // 存在数组中是 a[0] = 4 3 2 1~ 因为如果 a[0]是 1 每次在数组头加一位非常麻烦 // 高精度2的N次幂 #include <cstdio> #include <cmath> using namespace std; const int N = 3010; int main(){ int a[N] = {1}; int n; sc
4461 分鐘

#include <iostream> #include <string> using namespace std; int main () { string str1 = "runoob"; string str2 = "google"; string str3; int len ; // 复制 str1 到 str3 str3 = str1; cout << "str3 : " &
2641 分鐘

#include <cstdio> #include <cstring> #include <iostream> using namespace std; int main(){ char s1[100], s2[100]; scanf("%s%s", s1, s2); cout << strcmp(s1, s2) << endl; return 0; }//为甚么输出的是-100 0 100 踏马的不应该输出
1.6k1 分鐘

#include <iostream> //string 只要有iostream就可以用string了 using namespace std; int main(){ // 初始化字符串方式 string s1;// 默认的空字符串 string s2 = s1;//可以动态 s2是s1的一个副本 string s3 = "hiya";//s3是该字符串字面值的一个副本 string s
8031 分鐘

#include <cstdio> #include <iostream> using namespace std; int main(){ char a1[] = {'C', '+', '+'};//如果输出a1的话 他会输出到\0为止所以他会输出C++C++ char a2[] = {'C', '+', '+', '\0'}; char a
7141 分鐘

#include <iostream> #include <cstdio> #include <cmath> #include <cstring> using namespace std; int main(){ int a[10], b[10]; // for(int i = 0; i < 10; i ++) a[i] = 0; // for(int i = 0; i < 10; i ++) printf(
4931 分鐘

#include <cstdio> #include <cmath> using namespace std; const double eps = 1e-6; //常量 double前加const 这个数不能变 变了就报错 int main(){ // double x = 1.23456789; // float a = x * x; // float b = sqrt(a);
5131 分鐘

#include <iostream> #include <cstdio> #include <cmath> #include <cstring> using namespace std; int main(){ int a[10], b[10]; for(int i = 0; i < 10; i++) a[i] = ((((((((((((((((i)))))))))))))))); // ()括号是可以随便加的 (主要的作用是让代码先执行哪儿一部分内
2771 分鐘

#include <iostream> #include <ctime> using namespace std; int main(){ int start_time = clock();//clock会返回这个程序的开始时刻 这个函数在ctime里面 int end_time = clock() - start_time; string a; getline(cin, a); printf("%s\n%d", a, end_time);
9551 分鐘

#include <iostream> using namespace std; int main(){ // char c = 'a'; // cout << (int)c << endl;//97 // cout << (char)97 <<endl;//a // for(int i = 1; i &l