当前位置:网站首页>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 .
边栏推荐
- Work and leisure suggestions of old programmers
- Happy new year | 202112 monthly summary
- JDBC: deep understanding of Preparedstatement and statement[easy to understand]
- Glidefast consulting was selected as the elite partner of servicenow in 2022
- 股票万1免5证券开户是合理安全的吗,怎么讲
- Basic usage of shell script
- Unity3d extended toolbar
- Is Huishang futures a regular futures platform? Is it safe to open an account in Huishang futures?
- Data warehouse (3) star model and dimension modeling of data warehouse modeling
- PIP version problems: PIP problems still occur when installing akshare and using Tsinghua source and Douban source
猜你喜欢

Highly reliable program storage and startup control system based on anti fuse FPGA and QSPI flash

transform. Forward and vector3 Differences in the use of forward

Penetration practice vulnhub range Keyring

Setting up a time server requires the client to automatically synchronize the time of the server at 9 a.m. every day

Distributed task queue: Celery usage record

Work and leisure suggestions of old programmers

Source code of new campus errand / campus task platform on mutual station

Oracle TRUNC function processing date format

2022 Heilongjiang latest fire protection facility operator simulation test question bank and answers

Intelligent operation and maintenance practice: banking business process and single transaction tracking
随机推荐
Definition of rotation axis in mujoco
Is online stock account opening safe? Is it reliable?
EasyCVR通过国标GB28181协议接入设备,出现设备自动拉流是什么原因?
t10_ Adapting to Market Participantsand Conditions
New patent applications and transfers
Radhat builds intranet Yum source server
Good looking UI mall source code has been scanned, no back door, no encryption
How to use JMeter function and mockjs function in metersphere interface test
期货先锋这个软件正规吗安全吗?选择哪家期货公司更安全?
When the fixed frequency artifact falls in love with multithreading | ros2 fixed frequency topic release demo
SLO is increasingly used to achieve observability | Devops
Cloud picture says | distributed transaction management DTM: the little helper behind "buy buy buy"
Nearly 60% of the employees strongly support Ctrip's "3+2" working mode, and work at home for two days a week
The new server is packaged with the source code of H5 mall with an operation level value of several thousand
SQL injection vulnerability (MySQL and MSSQL features)
Mujoco XML modeling
ISO 27001 Information Security Management System Certification
. Net cloud native architect training camp (permission system code implements actionaccess) -- learning notes
MySQL -- explain performance optimization
February 16, 2022 Daily: graph neural network self training method under distribution and migration