《关于我写了50行暴力if代码却对了这件事》 展示代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int i,j,a[20][50],r,c;
cin>>i >>j;
if(j>=1 and j<=4){
r=1;
}
else if(j>=5 and j<=8){
r=2;
}
else if(j>=9 and j<=12){
r=3;
}
else if(j>=13 and j<=16){
r=4;
}
else if(j>=17 and j<=20){
r=5;
}
else if(j>=21 and j<=24){
r=6;
}
else if(j>=25 and j<=28){
r=7;
}
else if(j>=29 and j<=32){
r=8;
}
else if(j<=33 and j<=36){
r=9;
}
else{
r=10;
}
j%=4;
if(j==0){
c=i+30;
}
else if(j==1){
c=i+0;
}
else if(j==2){
c=i+10;
}
else{
c=i+20;
}
cout<<r <<" "<<c;
return 0;
}