20241221C++笔记
Allen 2024-12-21 16:54
找回文数组: #includeiostream using namespace std; int main() { int n; int ar ; bool b; cinn; for(int i=0;in;i++){ cinar ; } for(int i=0;i(n+1)/2;i++){ if(ar ==ar ){ b=1; }else{ b=0; break; ...
18 次阅读|0 个评论
20241207C++NOTE
Allen 2024-12-7 16:46
#includeiostream using namespace std; int main() { int n = 1, f = 0, sum = 0; int ar ; while (n) { cin n; if(!n){ break; } if (n) { for (int i = 0; i n; i++) { cin ar ; } } for (int i = 0; i ...
59 次阅读|0 个评论
Array C++ note
Allen 2024-11-30 17:48
#includeiostream using namespace std; int main(){ int ar ; int n; cinn; for(int i=0;in;i++){ cinar ; } for(int i=n-1;i=0;i--){ coutar " "; } return 0; } #includeiostream using namespace std;&nb ...
96 次阅读|0 个评论
2024C++note
Allen 2024-11-30 16:31
#includeiostream using namespace std; int Getmax(int a,int b,int c){ if(a=ba=c){ return a; }else if(b=cb=a){ return b; }else{ return c; } } int main(){ int a,b,c; cinabc; coutGetmax(a,b,c); } ...
87 次阅读|0 个评论
20241123C++笔记
Allen 2024-11-23 16:23
#includeiostream using namespace std; int main() { float x,a=1; int n,b; cinxn; for(int i=1;i=n;i++){ b=1; for(int j=1;j=i;j++){ b*=x; } a+=b; } printf("%.2f",a); return 0; } #includeiostream ...
85 次阅读|0 个评论
20241116C++
Allen 2024-11-16 17:32
#includeiostream using namespace std; int main() { int n, a1, a2, temp; bool r; cin n a1 a2; int d; d = a2 - a1; temp = a2; for (int i = 2; i n; i++) { int ai; cin ai; if (ai == temp + d) { r = 1; temp = ...
104 次阅读|0 个评论
C++ homework
Allen 2024-11-9 13:21
弹力球 #includeiostream using namespace std; int main() { float a, h, i; cin a; h = a; for (i = 0; i 9; i++) { h += a; a /= 2; } a /= 2; //因为这里漏算了第十次弹起的高度 cout h endl a; return 0; } ...
114 次阅读|0 个评论
20241102C++笔记
Allen 2024-11-2 16:50
#includeiostream using namespace std; int main() { int n,a,b,c,suma=0,sumb=0,sumc=0,sum; cinn; for(int i=1;i=n;i++){ cinabc; suma+=a; sumb+=b; sumc+=c; } sum=suma+sumb+sumc; coutsuma" "sumb" "sum ...
110 次阅读|0 个评论
20241026c++笔记
Allen 2024-10-26 16:14
第一个程序 #includeiostream using namespace std; int main() { int n,i=0; cinn; while(n!=1){ if(n%2==1){ n=3*n+1; }else { n=n/2; } i++; } couti; return 0; } 等同于#includeiostream ...
166 次阅读|0 个评论
2023-07-26
tiger 2023-7-26 10:26
hihihihihihi
380 次阅读|1 个评论 热度 1
返回顶部