点击这里更换您喜欢的皮肤wtboj 首页
请点击这里登入noios   首页 入门 c++讲义 入门教程视频 其他页面 入门视频 站务 公告 | 题库 记录 竞测 测试 闯关 作业 排名 团队 讨论 | 换肤 | 登入 注册  
News >>   新增功能:各团队管理员可以发布本团队作业了 ()

讨论 Discussion
 
78
#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("p1725.in","r",stdin);
freopen("p1725.out","w",stdout);
int n,i,j,k,a[11][11]={0};
cin>>n;  
for(k=1;k<=n;k++) {
for(j=1;j<=n+1-k;j++)a[n+1-k][j]=k;    
for(i=1;i<=n+1-k;i++)a[i][n+1-k]=k;  
}    
for(i=1;i<=n;i++){    
for(j=1;j<=n;j++)cout<<setw(3)<<a[i][j];
cout<<endl;
}
fclose(stdin);
fclose(stdout);
return 0;
}

#include <iostream>
using namespace std;
int main() {
freopen("p1051.in","r",stdin);
freopen("p1051.out","w",stdout);
int n, x;
cin >> n >> x;  
int count= 0 ;
int score;  
for (int i = 0; i < n; i++) {
cin >> score;
if (score > x) {
count++;
}
}
cout << count + 1 << endl;
fclose(stdin);
fclose(stdout);
return 0;
}

#include <iostream>
using namespace std;
int main() {
freopen("p1047.in","r",stdin);
freopen("p1047.out","w",stdout);
int n;
cin >> n;
int triangle[n][n];
int num = 1;
for (int col = 0; col < n; col++) {
for (int row = col; row < n; row++) {
triangle[row][col] = num++;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j <= i; j++) {
if (j > 0) cout << " ";
cout << triangle[i][j];
}
cout << endl;
}
fclose(stdin);
fclose(stdout);
return 0;
}

#include <iostream>
using namespace std;
int main() {
freopen("p1031.in","r",stdin);
freopen("p1031.out","w",stdout);
long long n;
cin >> n;
long long left = 1, right = 1e9;
while (left < right) {
long long mid = (left + right) / 2;
if (mid * mid >= n) {
right = mid;
} else {
left = mid + 1;
}
}
cout << 2 * left << endl;
fclose(stdin);
fclose(stdout);
return 0;
}







( )

此主题无回复显示
发布讨论主题 回复讨论主题
 Copyright wtboj © 2005-2006. www.wutuobang.date Powered by wtboj 关于 联系 帮助
 wtboj Information ---- Total Users : 1367 | Online Users / Processes : 0 / 12 | Processed Time : 31 ms | Server Time : 2026/1/29 10:30:11