- 【基础】统计每个数出现的次数
4.11
- @ 2025-12-18 15:56:36
#include<iostream>
using namespace std;
int main(){
cout<<"Welcome";
return 0;
}
8 条评论
-
苏芷萱 @ 2026-3-24 15:42:30#include<bits/stdc++.h> using namespace std; int a[10][10],b[10][10]; int dx[] = {-1, 1, 0, 0, -1, -1, 1, 1}; int dy[] = {0, 0,-1, 1, -1, 1, -1, 1}; int main(){ int m,n; cin>>m>>n; a[5][5] = m; for(int d = 1;d <= n;d++){ memset(b,0,sizeof b); for(int i = 1;i <= 9;i++){ for(int j = 1;j <= 9;j++){ if(a[i][j]!=0){ b[i][j] += 2 * a[i][j]; for(int k = 0;k < 8;k++){ int nx = i + dx[k]; int ny = i + dy[k]; if(nx > 0 && nx < 10 && ny > 0 && ny < 10) b[nx][ny] += a[i][j]; } } } } for(int i = 1;i <= 9;i++){ for(int j = 1;j <= 9;j++) a[i][j] = b[i][j]; } } for(int i = 1;i <= 9;i++){ for(int j = 1;j <= 9;j++) cout << b[i][j] << " "; cout<<endl; } return 0; } -
@ 2026-3-24 15:37:19细菌的繁殖与扩散
-
@ 2026-3-24 15:36:19#include<bits/stdc++.h> using namespace std; int a[10][10],b[10][10]; int dx[] = {-1, 1, 0, 0, -1, -1, 1, 1}; int dy[] = {0, 0,-1, 1, -1, 1, -1, 1}; int main(){ int m,n; cin>>m>>n; a[5][5] = m; for(int d = 1;d <= n;d++){ memset(b,0,sizeof b); for(int i = 1;i <= 9;i++){ for(int j = 1;j <= 9;j++){ if(a[i][j]!=0){ b[i][j] += 2 * a[i][j]; for(int k = 0;k < 8;k++){ int nx = i + dx[k]; int ny = i + dy[k]; if(nx > 0 && nx < 10 && ny > 0 && ny < 10) b[nx][ny] += a[i][j]; } } } } for(int i = 1;i <= 9;i++){ for(int j = 1;j <= 9;j++) a[i][j] = b[i][j]; } } for(int i = 1;i <= 9;i++){ for(int j = 1;j <= 9;j++) cout << b[i][j] << " "; cout<<endl; } return 0; } -
@ 2026-3-23 8:31:10自己手敲
劣质小游戏 -
@ 2026-3-23 8:30:25小游戏
#include <bits/stdc++.h> #include <windows.h> #include <time.h> using namespace std; signed main(){ cout<<"欢迎来到??世界"<<endl<<"请输入您在游戏中的名称:"; system("color Cf"); string a; cin>>a; cout<<endl; cout<<"正在加载中,请稍后..."<<endl; cout<<"%10 ▏"<<endl; Sleep(500); cout<<"%20 ▏▎"<<endl; Sleep(500); cout<<"%30 ▏▎▍"<<endl; Sleep(500); cout<<"%40 ▏▎▍▌"<<endl; Sleep(500); cout<<"%50 ▏▎▍▌▋"<<endl; Sleep(500); cout<<"%90 ▏▎▍▌▋▊▉"<<endl; Sleep(500); cout<<"正在进入中..."<<endl; Sleep(2500); cout<<"进入成功!"<<endl; Sleep(600); cout<<"△▽○◇□☆▲▼●◆■★"<<endl; cout<<"游戏名:我闲的?!"<<endl; cout<<"作者:柳"<<endl; cout<<"您好!!\n~~你给我查看规则,否则根本不会玩~~"<<endl; cout<<"规则:\n↖ ↑ ↗\n← ? →\n↙ ↓ ↘\n"; cout<<"您好,尊贵的"<<a<<"用户,已为您新建世界\n"; cout<<"加载地形中...\n"; cout<<"%10 ▏"<<endl; Sleep(500); cout<<"%20 ▏▎"<<endl; Sleep(500); cout<<"%30 ▏▎▍"<<endl; Sleep(500); cout<<"%40 ▏▎▍▌"<<endl; Sleep(500); cout<<"%50 ▏▎▍▌▋"<<endl; Sleep(500); cout<<"%90 ▏▎▍▌▋▊▉"<<endl; Sleep(1500); cout<<"进入成功!\n"; cout<<"规则:\n"; cout<<" 我建议你晚上不要出了你的家~~~\n"; return 0; } -
@ 2026-3-22 11:59:40 -
@ 2026-3-19 16:15:10#include<iostream> using namespace std; int main(){ long long k,day=1,coin=1,sum=0; cin>>k; for(int i=1; i<k; ++i){ sum+=coin; day++; if( ){ coin++; } } cout<<sum; return 0; } -
@ 2026-1-15 15:50:18#include<bits/stdc++.h> using namespace std; const int N=100008; int a[N]; double b[N]; void sel(int n){ for(int i=1;i<n;++i) for(int j=i+1;j<=n;++j){ if(b[i]<b[j]){ swap(b[i],b[j]); swap(a[i],a[j]); } } return ; } int main(){ int n,x,cnt=0; cin>>n>>x; for(int i=1;i<=n;++i){ cin>>a[i]>>b[i]; b[i]*=1.0; } sel(n); for(int i=1;i<=n;++i){ if(i==x) cout<<a[i]<<" "<<b[i]; } return 0; }
- 1
信息
- ID
- 150
- 时间
- ms
- 内存
- MiB
- 难度
- 6
- 标签
- 递交数
- 125
- 已通过
- 43
- 上传者