当前位置:网站首页>PTA year of birth
PTA year of birth
2022-07-01 18:17:00 【weCream】
answer :
#include<stdio.h>
int main()
{
int n,i;
char q;
scanf("%c %d",&q,&n);
getchar();
char gird[n][n];
for(i=0;i<n;i++){
gets(gird[i]);
}
int same=1,j;
// Judge whether to fall
for(i=n-1;i>=0;i--){
for(j=n-1;j>=0;j--){
if(gird[n-1-i][n-1-j]!=gird[i][j]){
same=0;
break;
}
}
}
if(same==1){
printf("bu yong dao le ");
}
int cnt=0;
for(i=n-1;i>=0;i--){
for(j=n-1;j>=0;j--){
// If it is not a space, replace the character
if(gird[i][j]!=' '){
gird[i][j]=q;
}
printf("%c",gird[i][j]);
cnt++;
if(cnt==n){
cnt=0;
printf(" ");
}
}
}
return 0;
}
Limited ability , The code is not concise enough , I hope the boss will criticize and correct me .
边栏推荐
- On the language internationalization of Yongzhong Office
- Single element of an ordered array
- Flex layout
- Gameframework eating guide
- Check log4j problems using stain analysis
- New patent applications and transfers
- The difference and relationship between iteratible objects, iterators and generators
- Setting up a time server requires the client to automatically synchronize the time of the server at 9 a.m. every day
- Step size of ode45 and reltol abstol
- Can hero sports go public against the wind?
猜你喜欢
Mujoco XML modeling
How to write good code - Defensive Programming Guide
Highly reliable program storage and startup control system based on anti fuse FPGA and QSPI flash
June issue | antdb database participated in the preparation of the "Database Development Research Report" and appeared on the list of information technology and entrepreneurship industries
How to retrieve the password for opening Excel files
Yuancosmos game farmersworld farmers world - core content of the second conference in China!
Yolov5 practice: teach object detection by hand
Record 3 - the state machine realizes key control and measures the number of external pulses
New 95 community system whole station source code
Mujoco model learning record
随机推荐
The difference and relationship between iteratible objects, iterators and generators
Countdownlatch blocking wait for multithreading concurrency
Fix the problem that easycvr device video cannot be played
[splishsplash] about how to receive / display user parameters, MVC mode and genparam on GUI and JSON
MySQL -- explain performance optimization
传感器尺寸、像素、DPI分辨率、英寸、毫米的关系
Cassette helicopter and alternating electric field magnetic manometer DPC
Replace UUID, nanoid is faster and safer!
Zabbix报警执行远程命令
[2. Basics of Delphi grammar] 4 Object Pascal operators and expressions
证券开户安全么,有没有什么样的危险呢
Draw drawing process of UI drawing process
Euler function: find the number of numbers less than or equal to N and coprime with n
Length of learning and changing
MES production equipment manufacturing execution system software
Nearly 60% of the employees strongly support Ctrip's "3+2" working mode, and work at home for two days a week
Leetcode 1380. Lucky numbers in the matrix (save the minimum number of each row and the maximum number of each column)
Key points on February 15, 2022
Debiasing word embeddings | talking about word embedding and deviation removal # yyds dry goods inventory #
开发那些事儿:EasyCVR平台添加播放地址鉴权