@xushuoxin 你真棒!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
关于徐硕新(字可能不对)是第一个上2000的事
#51题解
51 题是一道列举题,把所有两位数进行判断,最后判断是否相减的得数是36,如果是就输出i,不是就继续。
程序如下:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,x,y;
for(int i=10;i<=99;i++){
x=i/10;//十位。
y=i%10;//个位。
b=x*10+y;
a=y*10+x;
if(a-b==36){
cout << i << endl;
}
}
return 0;
}
如果你现在还没听懂,呢么我只能认为你没听课,自己再去问老师!!!**
#4868谁会???
谁会#4868??? 要急死啦!!!!!!
#71
include
using namespace std; int main() { int n; cin>>n; int a[n+1][n+1]; memset(a,0,sizeof(a)); int count=1; int x=1,y=1; a[x][y]=count; count++; while(count<=n*n) { while(a[x][y+1]==0&&y+1<=n) { y++; a[x][y]=count++; } //向右填 while(a[x+1][y]==0&&x+1<=n) { x++; a[x][y]=count++; } //向下填 while(a[x][y-1]==0&&y-1>=1) { y--; a[x][y]=count++; } //向左填 while(a[x-1][y]==0&&x-1>=1) { x--; a[x][y]=count; count++; } //向上填 } for(int i=1; i<=n; i++) { for(int j=1; j<=n; j++) cout<<setw(4)<<a[i][j]; cout<<endl; } return 0; }