文章

27

粉丝

86

获赞

10

访问

20.7k

头像
矩阵位置 题解:
P1543 云南大学机试题
发布于2023年8月17日 12:41
阅读数 712

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;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发