矩阵位置 题解:
C++
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main(){
int n;
int hang, lie;
while(cin >> n){
hang = (n - 1) / 3 + 1;
lie = (n - 1) % 3 + 1;
cout << hang << " " << lie << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发