Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- vector <int> answers(21), correct_answers(21), mistakes(21);
- int i;
- for (i=1; i<21; i++) {
- answers[i]=0;
- correct_answers[i]=0;
- mistakes[i]=0;
- }
- for (i=1; i<21; i++) {
- // cout<<"Вопрос №"<<i<<": ";
- cin>>answers[i];
- cout<<endl;
- }
- for (i=1; i<21; i++) {
- // cout<<"Правильный ответ на вопрос №"<<i<<": ";
- cin>>correct_answers[i];
- cout<<endl;
- }
- for (i=1; i<21; i++) {
- if (answers[i]!=correct_answers[i]) mistakes[i]=1;
- }
- bool wrong=0;
- for (i=1; i<21; i++) {
- if (mistakes[i]!=0) wrong=1;
- }
- if (wrong) {
- for (i=1; i<21; i++) {
- if (mistakes[i]==1) cout<<"Ошибка в вопросе №"<<i<<", Ваш ответ: "<<answers[i]<<", правильный ответ: "<<correct_answers[i]<<endl;
- }
- } else {
- cout<<"Ни единой ошибки!";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement