Untitled

 avatar
unknown
c_cpp
2 years ago
435 B
4
Indexable
#include <iostream>
#include <string>
using namespace std;

int main()
{
	int n;
	cin >> n;
	int a;
	int x = 1;
	int y = 1;
	int sum = 0;
	int x1 = 0;
	int y1 = 0;
	for (int i = 0; sum!=n; i++){
		cin >> a;
		if (a == 1) {
			x1 = x;
			y1 = y;
		}
		x += 1;
		if (x==11) {
			x = 1;
			y += 1;
		}
		if (y == 11) {
			x = 1;
			y = 1;
			cout << x1 << " " << y1;
			cout << endl;
			sum += 1;
		}
	}
}
Editor is loading...