code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
package com.dlmu.TreeMap; import java.util.TreeMap; import java.util.function.BiConsumer; public class TreeMapDemo { public static void main(String[] args) { TreeMap<Student,String> tm=new TreeMap<>(); Student s1=new Student("zhangsan",11); Student s2=new Student("Lisi",22); Student s3=new Student("Wangwu",33); tm.put(s1, "江西"); tm.put(s2,"赣州"); tm.put(s3,"上犹"); System.out.println(tm); } }
2203_75730178/test1
src/com/dlmu/TreeMap/TreeMapDemo.java
Java
unknown
485
package com.dlmu.TreeMap; import java.util.TreeMap; import java.util.function.BiConsumer; public class TreeMapDemo1 { public static void main(String[] args) { String str="abcccabaccaab"; TreeMap<Character,Integer>tm=new TreeMap<>(); for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if(tm.containsKey(c)){ int count=tm.get(c); count++; tm.put(c,count); }else { tm.put(c,1); } } StringBuilder sb=new StringBuilder(); tm.forEach(new BiConsumer<Character, Integer>() { @Override public void accept(Character character, Integer integer) { sb.append(character).append("(").append(integer).append(")"); } }); System.out.println(tm); System.out.println("----------"); System.out.println(sb); } }
2203_75730178/test1
src/com/dlmu/TreeMap/TreeMapDemo1.java
Java
unknown
960
int add(int a,int b){ int c = a + b; return c; }
2201_75539691/C_plus_splus
2024.11.18/add.c
C
unknown
51
#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { int a = 10; int b = 20; int result = add(a,b); printf("%d",result); return 0; }
2201_75539691/C_plus_splus
2024.11.18/main.c
C
unknown
263
#include<stdio.h> int main() { printf("hello C\n"); return 0; }
2201_75539691/C_plus_splus
2024.11.18/test1.cpp
C++
unknown
69
#include <iostream> using namespace std; int main() { cout << sizeof(char) << endl; cout << sizeof(bool) << endl; cout << sizeof(short) << endl; cout << sizeof(int) << endl; cout << sizeof(long) << endl; cout << sizeof(long long) << endl; cout << sizeof(float) << endl; cout << sizeof(double) << endl; cout << sizeof(long double) << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.29/test1.cpp
C++
unknown
366
#include <iostream> #include <climits> using namespace std; int main() { cout << "char: " << CHAR_MIN << " to " << CHAR_MAX << endl; cout << "unsigned char: 0 to " << UCHAR_MAX << endl; cout << "short: " << SHRT_MIN << " to " << SHRT_MAX << endl; cout << "unsigned short: 0 to " << USHRT_MAX << endl; cout << "int: " << INT_MIN << " to " << INT_MAX << endl; cout << "unsigned int: 0 to " << UINT_MAX << endl; cout << "long: " << LONG_MIN << " to " << LONG_MAX << endl; cout << "unsigned long: 0 to " << ULONG_MAX << endl; cout << "long long: " << LLONG_MIN << " to " << LLONG_MAX << endl; cout << "unsigned long long: 0 to " << ULLONG_MAX << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.29/test2.cpp
C++
unknown
705
#include <iostream> using namespace std; int main() { int number; cin >> number; cout << number << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.29/test3.cpp
C++
unknown
121
#include <iostream> using namespace std; int main() { signed int num; cin >> num; char ch = num; cout << ch << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.29/test4.cpp
C++
unknown
135
#include <iostream> using namespace std; int main() { char ch; cin >> ch; cout << ch << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.29/test5.cpp
C++
unknown
111
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << c << " " << b << " " << a << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.29/test6.cpp
C++
unknown
148
#include <iostream> using namespace std; int main() { int a; short b; cout << sizeof(a) << " " << sizeof(b) << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.29/test7.cpp
C++
unknown
137
#include <iostream> using namespace std; int main() { char a = 127; char b = a + 1; cout << (int)b << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/tes8.cpp
C++
unknown
130
#include <iostream> using namespace std; int a; char c; float f; double d; int main () { // int a; // char c; // float f; // double d; cout << "int:" << a << endl; cout << "char:" << c << endl; cout << "float:" << f << endl; cout << "double:" << d << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test1.cpp
C++
unknown
283
#include <iostream> using namespace std; int main() { int a; cin >> a; // cout << (a % 100) / 10 << endl; cout << (a / 10) % 10 << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test11.cpp
C++
unknown
157
#include <iostream> using namespace std; int main() { int a; cin >> a; cout << (a / 10) % 10 << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test12.cpp
C++
unknown
131
#include <iostream> using namespace std; int main() { int seconds; cin >> seconds; cout << seconds / 3600 << " " << (seconds / 60) % 60 << " " << seconds % 60; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test13.cpp
C++
unknown
177
#include <iostream> using namespace std; int main() { int a, b, c, d; int sum_time, hour, minute; cin >> a >> b >> c >> d; sum_time = (c * 60 + d) - (a * 60 + b); hour = sum_time / 60; minute = sum_time % 60; cout << hour << " " << minute << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test14.cpp
C++
unknown
269
#include <iostream> using namespace std; #define M 66 int main() { int m = M; cout << m << endl; cout << M << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test3.cpp
C++
unknown
139
#include <iostream> #define PRICE 100 using namespace std; int main() { // const int PRICE = 100; int x; cin >> x; cout << x * PRICE << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test4.cpp
C++
unknown
160
#include <iostream> using namespace std; int main() { int rabbit, chicken; int head = 35; int foot = 94; chicken = (4*head - foot) / 2; rabbit = head - chicken; cout << rabbit << " " << chicken << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test6.cpp
C++
unknown
225
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << (a + b) * c << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test8.cpp
C++
unknown
134
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << a / b << " " << a % b << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test9.c
C
unknown
136
#include <iostream> using namespace std; int main() { int a; cin >> a; cout << a % 10 << endl; return 0; }
2201_75539691/C_plus_splus
2024.11.30/test9.cpp
C++
unknown
113
#include <iostream> using namespace std; int main() { int ch = getchar(); cout << ch << endl; cout << (char)ch; cout << "xxxx" << endl; ch = getchar(); cout << (char)ch; return 0; } // //int main() { // int ch = getchar(); // cout << ch << endl; // cout << (char)ch << endl; // return 0; //}
2201_75539691/C_plus_splus
2024.12.1/test11.cpp
C++
unknown
308
#include <iostream> using namespace std; int main() { int ch = getchar(); cout << ch << endl; cout << (char)ch; ch = getchar(); cout << ch << endl; cout << (char)ch; cout << "xxxx" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.1/test12.cpp
C++
unknown
214
#include <iostream> #include <cstdio> using namespace std; int main() { printf("hello\nworld"); return 0; }
2201_75539691/C_plus_splus
2024.12.1/test13.cpp
C++
unknown
114
#include <cstdio> using namespace std; int main() { // printf("tom is %d years old.\n", 21); printf("%s will come %d", "tom"); return 0; }
2201_75539691/C_plus_splus
2024.12.1/test14.cpp
C++
unknown
148
#include <cstdio> using namespace std; int main() { printf("%5d\n", 666); printf("%5d\n", 6); printf("%6.2f\n", 0.5); printf("%*.*f\n", 6, 2, 0.5); return 0; }
2201_75539691/C_plus_splus
2024.12.1/test15.cpp
C++
unknown
171
#include <iostream> using namespace std; int main() { char a = 'a'; int b = 10; char c = a + b; cout << c << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.1/test3.cpp
C++
unknown
136
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int r = (int)(a * 0.2 + b * 0.3 + c * 0.5) cout << r << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.1/test5.cpp
C++
unknown
168
#include <iostream> using namespace std; int main() { double x; cin >> x; long long num = (long long)x; cout << num << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.1/test6.cpp
C++
unknown
142
#include <iostream> using namespace std; int main() { int num; cin >> num; char ch = (char)num; cout << ch << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.1/test7.cpp
C++
unknown
133
#include <iostream> using namespace std; int main() { char ch; cin >> ch; int num = (int)ch; cout << num << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.1/test9.cpp
C++
unknown
131
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int m = (a > b ? a : b); int n = (m > c ? m : c); cout << n << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.10/比特作业1.cpp
C++
unknown
179
#include <iostream> using namespace std; int main() { long long X, Y; cin >> X >> Y; long long Z = ((Y % X) == 0 ? X + Y : Y - X); cout << Z << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.10/比特作业2.cpp
C++
unknown
172
#include <iostream> using namespace std; int main() { int m, t, s, n; cin >> m >> t >> s; if(t == 0) n = 0; else n = (s % t != 0 ? (m - 1 - s / t < 0 ? 0 : m - 1 - s / t ) : (m - s / t < 0 ? 0 : m - s / t )); cout << n << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.10/比特作业3.cpp
C++
unknown
259
#include <iostream> using namespace std; int main() { int year; cin >> year; if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0) cout << 1 << endl; else cout << 0 << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.11/蓝桥杯1.cpp
C++
unknown
200
#include <iostream> using namespace std; int main() { int day; cin >> day; if(day == 1 || day == 3 || day == 5) cout << "NO" << endl; else cout << "YES" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.11/蓝桥杯2.cpp
C++
unknown
187
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; if(a + b > c && a + c > b && b + c > a && a - b < c && a - c < b && b - c < a) cout << 1 << endl; else cout << 0 << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.12/蓝桥杯3.cpp
C++
unknown
233
#include <iostream> using namespace std; int main() { int x; cin >> x; if(x % 3 == 0) cout << 3 << " "; if(x % 5 == 0) cout << 5 << " "; if(x % 7 == 0) cout << 7 << " "; if(x % 3 != 0 && x % 5 != 0 && x % 7 != 0) cout << "n" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.12/蓝桥杯4.cpp
C++
unknown
265
#include <iostream> using namespace std; int main() { int x; cin >> x; if(x % 2 == 0 && (x > 4 && x <= 12)) cout << 1 << " "; else cout << 0 << " "; if(x % 2 == 0 || (x > 4 && x <= 12)) cout << 1 << " "; else cout << 0 << " "; if((x % 2 == 0 && !(x > 4 && x <= 12)) || (!(x % 2 == 0) && x > 4 && x <= 12)) cout << 1 << " "; else cout << 0 << " "; if(x % 2 != 0 && !(x > 4 && x <= 12)) cout << 1 << " "; else cout << 0 << " "; return 0; }
2201_75539691/C_plus_splus
2024.12.12/蓝桥杯5.cpp
C++
unknown
469
#include <iostream> using namespace std; int main() { int a, b; char c; cin >> a >> b >> c; switch (c) { case '+': cout << a + b << endl; break; case '-': cout << a - b << endl; break; case '*': cout << a * b << endl; break; case '/': if (b == 0) cout << "Divided by zero!" << endl; else cout << a / b << endl; break; default: cout << "Invalid operator!" << endl; break; } return 0; }
2201_75539691/C_plus_splus
2024.12.13/test.cpp
C++
unknown
615
#include <iostream> using namespace std; int main() { int number; cin >> number; switch (number % 100) { case 3: case 4: case 5: cout << "spring" << endl; break; case 6: case 7: case 8: cout << "summer" << endl; break; case 9: case 10: case 11: cout << "autumn" << endl; break; case 12: case 1: case 2: cout << "winter" << endl; break; } return 0; }
2201_75539691/C_plus_splus
2024.12.13/比特C++蓝桥杯1.cpp
C++
unknown
408
#include <iostream> using namespace std; int main() { int a, b; char c; cin >> a >> b >> c; if(c != '+' && c != '-' && c != '*' && c != '/') { cout << "Invalid operator!" << endl; return 0; } if(b == 0) { cout << "Divided by zero!" << endl; return 0; } switch(int(c)) { case 43: cout << a + b << endl; break; case 45: cout << a - b << endl; break; case 42: cout << a * b << endl; break; case 47: cout << a / b << endl; break; } return 0; }
2201_75539691/C_plus_splus
2024.12.13/比特C++蓝桥杯2.cpp
C++
unknown
496
#include <iostream> using namespace std; int main() { int a; cin >> a; while(a != 0) { cout << a % 10; a /= 10; } return 0; }
2201_75539691/C_plus_splus
2024.12.16/比特2.cpp
C++
unknown
141
#include <iostream> using namespace std; int main() { int a, sum = 0; cin >> a; while(a) { sum += (a % 10); a /= 10; } cout << sum << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.16/比特3.cpp
C++
unknown
164
#include <iostream> using namespace std; int main() { int a, sum = 0; cin >> a; int i = 1; while(i <= a) { sum += i; i++; } cout << sum; return 0; }
2201_75539691/C_plus_splus
2024.12.16/比特4.cpp
C++
unknown
162
#include <iostream> using namespace std; int main() { long long m; long long k, count = 0; cin >> m >> k; while(m != 0) { if(m % 10 == 3) count++; m /= 10; } if(count == k) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.16/比特5.cpp
C++
unknown
256
#include <iostream> using namespace std; int main() { int a; cin >> a; while(a != 1) { if(a % 2 != 0) { cout << a << "*3+1="<< a * 3 + 1 << endl; a = a * 3 + 1; } if(a % 2 == 0) { cout << a << "/2="<< a / 2 << endl; a = a / 2; } } cout << "End" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.16/比特6.cpp
C++
unknown
300
#include <iostream> using namespace std; int main() { double x, n; double temp = 1; double result = 1; cin >> x >> n; while(n) { temp *= x; result += temp; n--; } printf("%.2lf\n", result); return 0; }
2201_75539691/C_plus_splus
2024.12.16/比特7.cpp
C++
unknown
220
#include <cstdio> int main() { int a; scanf("%d", &a); printf("%d", a); return 0; }
2201_75539691/C_plus_splus
2024.12.2/test1.cpp
C++
unknown
101
#include <cstdio> int main() { char a; scanf("%c", &a); printf("----%c----", a); return 0; }
2201_75539691/C_plus_splus
2024.12.2/test2.cpp
C++
unknown
99
#include <cstdio> int main() { int a = 0; int b = 0; float f = 0.0f; int r = scanf("%d %d %f", &a, &b, &f); printf("a = %d b = %d c = %f\n", a, b, f); printf("r = %d\n", r); return 0; }
2201_75539691/C_plus_splus
2024.12.2/test3.cpp
C++
unknown
195
#include <cstdio> int main() { int a = 0; int b = 0; scanf("%d%d", &a, &b); printf("%.3f", 1.0 * a / b); return 0; }
2201_75539691/C_plus_splus
2024.12.3/test1.cpp
C++
unknown
122
#include <cstdio> int main() { int F; scanf("%d", &F); printf("%.5f", 5.0*(F-32)/9); return 0; }
2201_75539691/C_plus_splus
2024.12.3/test3.cpp
C++
unknown
101
#include <cstdio> int main() { int r1, r2; double R; scanf("%d %d", &r1, &r2); R = 1.0/((1.0/r1)+(1.0/r2)); printf("%.2lf",R); return 0; }
2201_75539691/C_plus_splus
2024.12.3/test4.cpp
C++
unknown
145
#include <cstdio> #include <iostream> using namespace std; int main() { int r1, r2; double R; cin >> r1 >> r2; R = 1.0/((1.0/r1)+(1.0/r2)); printf("%.2lf",R); return 0; }
2201_75539691/C_plus_splus
2024.12.3/test4_2.cpp
C++
unknown
178
#include <cstdio> int main() { double r; scanf("%lf", &r); printf("%.4lf %.4lf %.4lf", 2 * r, 2 * 3.14159 * r, 3.14159 * r * r); return 0; }
2201_75539691/C_plus_splus
2024.12.3/test5.cpp
C++
unknown
145
#include <cstdio> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); printf("%8d %8d %8d", a, b, c); return 0; }
2201_75539691/C_plus_splus
2024.12.3/test6.cpp
C++
unknown
123
#include <cstdio> int main() { int a, b, c, d, e; scanf("%d %d %d %d %d", &a, &b, &c, &d, &e); printf("%d %d %d %d %d", a,(a/3+b)/); return 0; }
2201_75539691/C_plus_splus
2024.12.3/test7..cpp
C++
unknown
151
#include <cstdio> int main() { int a, b, c, d, e; scanf("%d %d %d %d %d", &a, &b, &c, &d, &e); a /= 3, e += a, b += a; b /= 3, a += b, c += b; c /= 3, b += c; d += c; d /= 3, c += d; e += d; e /= 3, d += e; a += e; printf("%5d%5d%5d%5d%5d\n", a, b, c, d, e); return 0; }
2201_75539691/C_plus_splus
2024.12.3/test8.cpp
C++
unknown
282
#include <cstdio> int main() { char a, b, c, d, e; scanf("%c%c%c.%c", &a, &b, &c, &d); printf("%c.%c%c%c\n", d, c, b, a); return 0; }
2201_75539691/C_plus_splus
2024.12.4/test11.cpp
C++
unknown
141
#include <iostream> using namespace std; int main() { int x, y, z; cin >> x >> y >> z ; cout << x << y << z << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.4/test2.cpp
C++
unknown
146
#include <iostream> using namespace std; int main() { char a, b, c, d, e; cin >> a >> b >> c >> d >> e; cout << e << d << c << b << a; return 0; }
2201_75539691/C_plus_splus
2024.12.4/test6.cpp
C++
unknown
155
#include <iostream> using namespace std; int main() { int n; float f; double d = 0.0; char c = '*'; cout << "address of n: " << &n << endl; cout << "address of f: " << &f << endl; cout << "address of d: " << &d << endl; cout << "address of c: " << &c << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.4/学堂在线1.cpp
C++
unknown
344
#include <iostream> using namespace std; int main() { int n; float f; double d = 0.0; char c = '*'; cout << "Address of n: " << &n << endl; cout << "Address of f: " << &f << endl; cout << "Address of d: " << &d << endl; cout << "Address of c: " << (void*)&c << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.4/学堂在线2.cpp
C++
unknown
318
#include <iostream> #include <iomanip> using namespace std; int main() { cout << left << setw(15) << "Name" << setw(10) << "Age" << setw(15) << "City" << endl; cout << setfill('-') << setw(40) << "" << setfill(' ') << endl; cout << left << setw(15) << "Alice" << setw(10) << 30 << setw(15) << "New York" << endl; cout << left << setw(15) << "Bob" << setw(10) << 25 << setw(15) << "Los Angeles" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.4/测试.cpp
C++
unknown
436
#include <iostream> #include <iomanip> using namespace std; int main() { double r = 2.52384; double s = 3.1415926 * r * r; cout << s << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.4/课堂在线作业1.cpp
C++
unknown
167
#include <iostream> #include <iomanip> using namespace std; int main() { int v, t; cin >> v >> t; double a = 1.0 * v / t; cout<< fixed << setprecision(4) << a <<endl; return 0; }
2201_75539691/C_plus_splus
2024.12.4/课堂在线作业2.cpp
C++
unknown
190
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { double a, b, c; cin >> a >> b >> c; double p = (a + b + c) / 2; double area = sqrt(p * (p - a) * (p - b) * (p - c)); cout<< fixed << setprecision(2) << area <<endl; return 0; }
2201_75539691/C_plus_splus
2024.12.4/课堂在线作业3.cpp
C++
unknown
279
#include <iostream> using namespace std; int main() { int a = 0; int b = 2; if (a == 1) { if (b == 2) { cout << "hehe" << endl; } } else { cout << "haha" << endl; } return 0; }
2201_75539691/C_plus_splus
2024.12.5/test.cpp
C++
unknown
238
#include <iostream> using namespace std; int main() { int n; cin >> n; if(n > 0) cout << "positive" << endl; else { if(n == 0) cout << "zero"; else cout << "negative"; } return 0; }
2201_75539691/C_plus_splus
2024.12.5/test3.cpp
C++
unknown
205
#include <iostream> using namespace std; int main() { int a = 0; int b = 2; if(a == 1) if(b == 2) cout << "hehe" << endl; else cout << "haha" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.5/test4.cpp
C++
unknown
185
#include <iostream> using namespace std; int main() { int num; cin >> num; if(num % 2 == 0) cout << "even" << endl; else cout << "odd" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.5/奇偶数判断.cpp
C++
unknown
166
#include <iostream> using namespace std; int main() { long long x, y; cin >> x >> y; if(x > y) cout << ">" << endl; else if(x == y) cout << "=" << endl; else cout << "<" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.5/整数大小比较.cpp
C++
unknown
204
#include <iostream> using namespace std; int main() { int m, n; cin >> m >> n; if(m % n == 0) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.5/整除判断.cpp
C++
unknown
168
#include <cstdio> int main() { char a, b, c, d, e; scanf("%c%c%c%c%c", &a, &b, &c, &d, &e); printf("%c%c%c%c%c\n",e, d, c, b, a); return 0; }
2201_75539691/C_plus_splus
2024.12.5/第一题.cpp
C++
unknown
149
#include <cstdio> #include <cmath> #include <iomanip> int main() { double a, b, c; scanf("%lf%lf%lf", &a, &b, &c); double p = 0.5 * (a + b + c); double s = sqrt(p * (p - a) * (p - b) * (p - c)); printf("%.1lf\n", s); return 0; }
2201_75539691/C_plus_splus
2024.12.5/第二题C做法.cpp
C++
unknown
240
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { float n; cin >> n; n = fabs(n); cout << fixed << setprecision(2) << n << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.5/输出绝对值-2.cpp
C++
unknown
188
#include <iostream> using namespace std; int main() { for (int i=0; i<3; i++) for (int j=1; j<= 6; j++) { cout << "C/C++" << endl; if ( j % 3 == 0) break; } }
2201_75539691/C_plus_splus
2024.12.6/学堂在线作业1.cpp
C++
unknown
217
#include <stdio.h> int main() { int murderer[6] = { 0 }; for (int i = 0; i < 6; ++i) { int is_truth[6] = { 0 }; int num_truth = 0; murderer[i] = 1; if (!murderer[0]) is_truth[0] = 1; if (murderer[0] || murderer[2]) is_truth[1] = 1; if (!is_truth[0] && !is_truth[1]) is_truth[2] = 1; if (murderer[5]) is_truth[5] = 1; if (!is_truth[2] && !is_truth[5]) is_truth[3] = 1; if (is_truth[0] && is_truth[3] && !is_truth[1] && !is_truth[2] && !is_truth[5]) is_truth[4] = 1; for (int j = 0; j < 6; ++j) if (is_truth[j]) num_truth++; if (num_truth == 3) printf("%c\n", 'A' + i); murderer[i] = 0; } return 0; }
2201_75539691/C_plus_splus
2024.12.6/学堂在线作业2.cpp
C++
unknown
839
#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { for(int j = 0; j < i; j++) { cout << "*"; } cout << endl; } return 0; }
2201_75539691/C_plus_splus
2024.12.6/学堂在线作业3.cpp
C++
unknown
197
#include <iostream> using namespace std; int main() { int year; cin >> year; if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }
2201_75539691/C_plus_splus
2024.12.6/学堂在线作业4.cpp
C++
unknown
224
#include <iostream> using namespace std; int main() { for (int i = 61; i<= 100; i++) if ( i % 2 == 0) }
2201_75539691/C_plus_splus
2024.12.6/测试.cpp
C++
unknown
108
#include <iostream> using namespace std; int main() { int n = 0; cin >> n; cout << (abs(n % 2) == 1 ? "odd" : "even") << "\n"; return 0; }
2201_75539691/C_plus_splus
2024.12.6/测试2.cpp
C++
unknown
156
#include <iostream> using namespace std; int main() { int r3, r5, r7; cin >> r3 >> r5 >> r7; for (int i = 0; i < 200; i++) { if (i % 3 == r3 && i % 5 == r5 && i % 7 == r7) { cout << i << endl; break; } } return 0; }
2201_75539691/C_plus_splus
2024.12.8/学堂在线1.cpp
C++
unknown
279
#include <iostream> using namespace std; int main() { int cards[13] = {7, 5, 1, 2, 3, 6, 8, 11, 9, 12, 10, 4, 13}; for (int i = 1; i < 13; i++) { int target = cards[i], pos = 0; while (target > cards[pos]) pos++; for (int j = i; j > pos; j--) cards[j] = cards[j - 1]; cards[pos] = target; } for(int i = 0; i < sizeof(cards)/sizeof(cards[0]); i++) { cout << cards[i] << " "; } return 0; }
2201_75539691/C_plus_splus
2024.12.8/学堂在线2.cpp
C++
unknown
436
#include <iostream> using namespace std; int main() { void SelectionSort(int [], int); int cards[13] = {7, 5, 1, 2, 3, 6, 8, 11, 9, 12, 10, 4, 13}; for (int i = 0; i < 13; i++) { int min = cards[i], min_id = i; for (int j = i + 1; j < 13; j++) if (cards[j] < min) { min = cards[j]; min_id = j; } cards[min_id] = cards[i]; cards[i] = min; } for(int i = 0; i < sizeof(cards)/sizeof(cards[0]); i++) { cout << cards[i] << " "; } return 0; }
2201_75539691/C_plus_splus
2024.12.8/学堂在线3.cpp
C++
unknown
522
#include <iostream> int josephus_recursive(int n, int k) { if (n == 1) { return 1; } else { return (josephus_recursive(n - 1, k) + k - 1) % n + 1; } } int main() { int n = 10; int k = 5; std::cout << josephus_recursive(n, k) << std::endl; return 0; }
2201_75539691/C_plus_splus
2024.12.8/学堂在线7.cpp
C++
unknown
297
#include <iostream> using namespace std; int main() { int a, b, c; int result = 0; cin >> a >> b >> c; if(a < 60) result++; if(b < 60) result++; if(c < 60) result++; if(result == 1) cout << 1 << endl; else cout << 0 << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.8/比特蓝桥杯.cpp
C++
unknown
260
#include <iostream> using namespace std; int main() { int a, b, c; int result = 0; cin >> a >> b >> c; if(a < 60) result++; if(b < 60) result++; if(c < 60) result++; if(result == 1) cout << 1 << endl; else cout << 0 << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.8/比特蓝桥杯1.cpp
C++
unknown
261
#include <iostream> using namespace std; int main() { int a1, a2, n; cin >> a1 >> a2 >> n; cout << (a2 - a1) * (n - 2) + a2 << endl; return 0; }
2201_75539691/C_plus_splus
2024.12.8/比特蓝桥杯2.cpp
C++
unknown
153
import { hapTasks } from '@ohos/hvigor-ohos-plugin'; export default { system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ }
2201_76010299/arkts_list_demo_9186
entry/hvigorfile.ts
TypeScript
unknown
227
import { appTasks } from '@ohos/hvigor-ohos-plugin'; export default { system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ }
2201_76010299/arkts_list_demo_9186
hvigorfile.ts
TypeScript
unknown
227
""" @Time: 2024/12/30 16:51 @Author: szkingdom-11 @File: 1.集合 @Project: su_demo01 @Software: PyCharm. """ # 特性:容器、可变、不允许重复数据 # 1. 创建集合 # v1 = set() # v2 = {11, 222, 33} # 2. 添加和删除 # v2 = {11, 222, 33} # v2.add(44) # v2.add(55) # print(v2) # # v2.discard(44) # v2.discard(55) # print(v2) # 3. 交并差 # v1 = {11, 22, 33} # v2 = {22, 33, 44} # # # 3.1 交集 # print(v1.intersection(v2)) # res = v1 & v2 # print(res) # # # 3.2 并集 # res = v1.union(v2) # print(res) # # res = v1 | v2 # print(res) # # # 3.3 差集 # res = v1.difference(v2) # print(res) # # # # res = v1 - v2 # print(res) # # 3.4 对称差 # res = v2.symmetric_difference(v1) # print(res) # res = v1 ^ v2 # print(res) # 4. 集合推导式 # v3 = { i for i in range(10)} # print(v3) data_list = ["张三", "李四", "王五"] v3 = {"我叫" + item for item in data_list if item != "张三"} print(v3)
2301_76469554/su_demo
1.集合.py
Python
unknown
930
# v1 = {item for item in range(10)} # 1. 字典推导式 # v2 = {item: 100 for item in range(10)} # {0:100,1:100.。} # print(v2) # v3 = {item: item + 10 for item in range(10)} # {0:10,1:11.。} # print(v3) # v4 = {item: item + 10 for item in range(10) if item >5} # print(v4) # {6: 16, 7: 17, 8: 18, 9: 19} # names = ["wupeiqi", "root", "admin"] # v5 = {item:100 for item in names} # print(v5) # {'wupeiqi': 100, 'root': 100, 'admin': 100} # # info = [("wupeiqi", 19), ("root", 20), ("admin", 21)] # v6 = {k: v for k, v in info if v > 19} # print(v6) # 2.创建字典的5种方式 # v1 = {} # 空字典 # v2 = dict() # 空字典 # v3 = {item: 100 for item in range(5)} # v4 = zip(["name", "age", "email"], ["吴佩奇", "35", "wupeiqi@live.com"]) # # for item in v4: # # print(item) # v4 = dict(v4) # print(v4) # v5 = dict.fromkeys(["name", "age", "email"], 100) # print(v5) # 3. value值的获取 info = {"name": "吴佩奇", "age": 35} # # res = info.get("name1", 100) # print(res) # 35 # info.setdefault("email", "wupeiqi@live.com") # print(info)
2301_76469554/su_demo
2.字典.py
Python
unknown
1,067
# 1. map() # numbers = [1, 2, 3, 4, 5] # # res = list(map(lambda x: x ** 2, numbers)) # print(res) # 2. filter() # numbers = [1, 2, 3, 4, 5] # even_numbers = filter(lambda x: x % 2 == 0, res) # print(list(even_numbers)) # 3. reduce() from functools import reduce numbers = [1, 2, 3, 4, 5] product = reduce(lambda x, y: x + y, numbers) print(product)
2301_76469554/su_demo
4.函数.py
Python
unknown
355
def outer(func): def inner(): # 在执行原函数前触发 print("装饰器开始执行") func() # 执行原函数 # 在执行员函数后触发 print("装饰器结束执行") return inner @outer def send_wechat(): print("微信") @outer def send_email(): print("邮件") @outer def send_sms(): print("短信") if __name__ == '__main__': send_wechat() send_email() send_sms()
2301_76469554/su_demo
5.装饰器.py
Python
unknown
459
def outer(func): def x(*args, **kwargs): # 在执行原函数前触发 print("装饰器开始执行") func(*args, **kwargs) # 执行原函数 # 在执行员函数后触发 print("装饰器结束执行") return x @outer # send_wechat = outer(send_wechat) def send_wechat(body): print("微信", body) if __name__ == '__main__': send_wechat("你好")
2301_76469554/su_demo
6.装饰器.py
Python
unknown
411