#include <iostream>
using namespace std;
void func1A()
{
int num = 0;
int max = 0;
int count1 = 0;
int index = 0;
int curr = 0;
cin >> num;
while ( num > index )
{
cin >> curr;
if ( curr == 1 )
{
count1++;
}
index++;
}
if ( count1 >= 2)
{
cout << 0;
}
else if ( count1 == 1)
{
cout << 1;
}
else
{
cout << 2;
}
cout << "\n";
cout << 2;
cout << "\n";
cout << "1 2";
cout << "\n";
}
int main()
{
func1A();
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #include <iostream> using namespace std; void func1A() { int num = 0; int max = 0; int count1 = 0; int index = 0; int curr = 0; cin >> num; while ( num > index ) { cin >> curr; if ( curr == 1 ) { count1++; } index++; } if ( count1 >= 2) { cout << 0; } else if ( count1 == 1) { cout << 1; } else { cout << 2; } cout << "\n"; cout << 2; cout << "\n"; cout << "1 2"; cout << "\n"; } int main() { func1A(); return 0; } |
English