Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main() {
- int x;
- int koloni = 0;
- int dali_sme_ja_pominale_prvata_dvojka = -1;
- int vkupno = 0;
- while(cin >> x) {
- if(x == 1 and dali_sme_ja_pominale_prvata_dvojka == -1) {
- koloni++;
- }
- if(x == 2) {
- dali_sme_ja_pominale_prvata_dvojka = 1;
- }
- vkupno++;
- if(x == 3) {
- break;
- }
- }
- koloni--;
- int redovi = vkupno / koloni;
- cout << redovi << " " << koloni << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement