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

From sina007
数字走向3
讨论 Discussion
 
哪位大神能帮我看一下这个哪错了
#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("P1709.in","r",stdin);
freopen("P1709.out","w",stdout);
  int i,j,n,k=0;
  int a[100][100]={0};
  cin>>n;
  for(j=1;j<=n;j++){
   for(i=j;i<=n;i++){
      k++;
      a[i][j]=k;
}
  }
  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++)cout<<a[i][j]<<" ";
    cout<<endl;
}
fclose(stdin);
fclose(stdout);
return 0;
  }
( )

cout<<setw(3)<<a[j][i];
cout<<endl;
( )
#include <bits/stdc++.h>
using namespace std;
int main(){
 freopen("p1619.in","r",stdin);
 freopen("p1619.out","w",stdout);
int n,i;
cin>>n;
while(n!=0){
while(n%2==0){
cout<<n<<"/2="<<n/2<<endl;
n=n/2;
}
if(n==1)break;
while(n%2!=0){
cout<<n<<"*3+1="<<n*3+1<<endl;
n=n*3+1;
  }
  if(n==1)break;
}
while(n<=0){
cout<<"错误";break;}
 fclose(stdin);
 fclose(stdout);
return 0;
}
( )
哪位大神能帮我看一下这个哪错了
#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("p1709.in","r",stdin);
freopen("p1709.out","w",stdout);
int n,i,j,k=0,a[100][100]={0};
cin>>n;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++){
k++;
a[i][j]=k;
}
for(i=1;i<=n;i++){
for(j=1;j<=n;j++)
cout<<setw(3)<<a[j][i];
cout<<endl;
}
fclose(stdin);
  fclose(stdout);
  return 0;
}
( )
#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("p1709.in","r",stdin);
freopen("p1709.out","w",stdout);
int n,i,j,k=0,a[100][100]={0};
cin>>n;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++){
k++;
a[i][j]=k;
}
for(i=1;i<=n;i++){
for(j=1;j<=n;j++)
cout<<setw(3)<<a[j][i];
cout<<endl;
}
fclose(stdin);
  fclose(stdout);
  return 0;
}
( )
635
?????????????????????????????????
( )
发布讨论主题 回复讨论主题
Flag
  
题号
  P1709
  模拟
通过
  54人
提交
  185次
通过率
  29%
难度
  0
提交 讨论 题解
 Copyright wtboj © 2005-2006. www.wutuobang.date Powered by wtboj 关于 联系 帮助
 wtboj Information ---- Total Users : 1242 | Online Users / Processes : 0 / 68 | Processed Time : 82 ms | Server Time : 2025/4/27 17:48:51