A
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;
int main()
{
int a[3][3];
int n=3;
for (int i=0;i<n;i++){
for (int j=0;j<n;j++){
scanf ("%d",&a[j][i]);
}
}
for (int i=0;i<n;i++){
for (int j=0;j<n;j++){
printf ("%d ",a[i][j]);
}
printf ("\n");
}
return 0;
}
B
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;
int main()
{
string a,b;
cin>>a>>b;
cout<<a<<b;
return 0;
}
C
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;
int main()
{
string a;
cin>>a;
string ans;
for (int i=0;i<a.size();i++){
if (a[i]=='a'||a[i]=='e'||a[i]=='i'||
a[i]=='o'||a[i]=='u'){
ans+=a[i];
}
}
cout<<ans;
return 0;
}
D
#include<iostream>
using namespace std;
int main()
{
int a;
scanf ("%d",&a);
int v[4];
int cnt=0;
while (a){
v[cnt++]=a%10;
a/=10;
}
for (int i=cnt-1;i>=0;i--){
printf ("%d ",v[i]);
}
return 0;
}
E
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;
int main()
{
string a;
getline(cin,a);
for (int i=0;i<a.size();i++){
if (a[i]>='a'&&a[i]<='z'){
a[i]=(a[i]-'a'+1)%26+'a';
}
}
cout<<a;
return 0;
}
F
//结构体排序
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;
struct student{
int a,b;
}st[1010];
bool cmp(student x,student y){
return x.a<y.a;
}
int main()
{
int n,m;
scanf ("%d %d",&n,&m);
for (int i=0;i<n+m;i++){
int a,b;
scanf ("%d%d",&a,&b);
st[i]={a,b};
}
sort(st,st+n+m,cmp);
for (int i=0;i<n+m;i++){
printf ("%d %d\n",st[i].a,st[i].b);
}
return 0;
}
G
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
int a[110][110];
for (int i=2,u=1;i<=n+1;i++){
for (int j=1;j<=i-1;j++,u++){
a[i-j][j]=u;
}
}
for (int i=1;i<=n;i++){
for (int j=1;j<=n-i+1;j++){
printf ("%d ",a[i][j]);
}
printf ("\n");
}
return 0;
}
H
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;
int main()
{
int a[20];
for (int i = 1; i <= 10; i ++ ){
scanf ("%d",&a[i]);
}
int p;
scanf ("%d",&p);
int ans=0;
for (int i = 1; i <= 10; i ++ ){
if (a[i]<=30+p) ans++;
}
printf ("%d",ans);
return 0;
}
I
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;
bool check1(string u){
if (u[0]=='-') return 0;
int t=0;
for (int i=0;i<u.size();i++){
if (u[i]>='0'&&u[i]<='9'){
t=t*10+u[i]-'0';
}
else return 0;
}
return t<=255;
}
bool check2(string a){
int l=0;
for (int i=0;i<a.size();i++){
if (a[i]=='.'){
string u=a.substr(l,i-l);
if (check1(u)){
l=i+1;
}
else return 0;
}
}
return check1(a.substr(l,a.size()-l));
}
int main()
{
string a;
while (cin>>a){
int p=check2(a);
if (p==1) printf ("Y\n");
else printf ("N\n");
}
return 0;
}
J
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
int f[150];
f[1]=1,f[2]=1;
for (int i = 3; i <= n; i ++ ){
f[i]=f[i-1]+f[i-2];
}
for (int i = 1; i <= n; i ++ ){
printf ("%d ",f[i]);
}
return 0;
}