|
|
|
|
讨论 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 |
|
|
|
|
|
|