厦门大学“网宿杯“17届程序设计竞赛决赛(同步赛)
A-这波啊,这波是……
签到题,照着输出就可
#include<bits/stdc++.h>
using namespace std;
int main()
{
cout<<"roudancongji";
}B-李在赣神魔
将矩阵顺时针旋转90度,就是把矩阵换个方向开始输出就行
把第一列从下到上当作第一行从左到右,其余列类似
#include<bits/stdc++.h>
using namespace std;
int n;
char tu[1005][1005];
int main()
{
cin>>n;
for(int i=0;i<n;i++)
cin>>tu[i];
for(int i=0;i<n;i++)
{
for(int j=n-1;j>=0;j--)
cout<<tu[j][i];
cout<<endl;
}
}电竞希金斯
ax+by+c=0
这题就是分类讨论。
分类情况代码中有,我就不重复了
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int main()
{
cin>>a>>b>>c;
if(a*b>0)
{
if(c==0)
cout<<"2 4";
else if(-b*c>0)
cout<<"1 2 4";
else
cout<<"2 3 4";
}
else if(a*b<0)
{
if(c==0)
cout<<"1 3";
else if(-b*c>0)
cout<<"1 2 3";
else
cout<<"1 3 4";
}
else if(a==0&&b==0)
{
if(c==0)
cout<<"1 2 3 4";
else cout<<"non";
}
else if(a==0)
{
if(c==0)cout<<"non";
else if(b*c>0)cout<<"3 4";
else cout<<"1 2";
}
else if(b==0)
{
if(c==0)cout<<"non";
else if(a*c>0)cout<<"2 3";
else cout<<"1 4";
}
}
