Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- typedef int_fast64_t lli;
- typedef long double ld;
- using namespace std;
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- lli n, correct = 0;
- cin >> n;
- for(lli i = 0; i < n; i++)
- {
- lli a, b, c;
- char op, e;
- cin >> a >> op;
- if(op == '/')
- {
- cin >> op;
- }
- cin >> b >> e >> c;
- switch(op)
- {
- case '+':
- correct += (a+b == c);
- break;
- case '-':
- correct += (a-b == c);
- break;
- case '*':
- correct += (a*b == c);
- break;
- case '/':
- correct += (b == 0 ? 0 : a/b == c);
- break;
- }
- }
- if(100*correct >= 70*n)
- {
- cout << "A\n";
- }
- else if(100*correct >= 60*n)
- {
- cout << "B\n";
- }
- else if(100*correct >= 50*n)
- {
- cout << "C\n";
- }
- else if(100*correct >= 40*n)
- {
- cout << "D\n";
- }
- else if(100*correct >= 30*n)
- {
- cout << "E\n";
- }
- else
- {
- cout << "F\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment