-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestScore.cpp
More file actions
37 lines (32 loc) · 817 Bytes
/
TestScore.cpp
File metadata and controls
37 lines (32 loc) · 817 Bytes
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
#include<iostream>
using namespace std;
int main(){
int T, N, X, Y;
do{
cout << "\nTest cases: ";
cin >> T;
}while(T < 1 || T > 100);
while(T--){
do{
cout << "\nNo. of problems: ";
cin >> N;
}while(N < 1 || N > 10);
do{
cout << "\nMarks recievable (apart from 0): ";
cin >> X;
}while(X < 1 || X > 10);
do{
cout << "\nTarget: ";
cin >> Y;
}while(Y < 0 || Y > N*X);
cout << "\nTarget achievable: ";
for(int i = 0; i <= N; i++){
if(X*i == Y){
cout << "Yes" << endl;
break;
}else if(i == N){
cout << "No" << endl;
}else{}
}
}
}