#include<iostream>
#include<vector>
using namespace std;
int main( )
{
float s; // assignment score
float t; // total points worth
float p; // percentage
int n;
//input the number of assignments
cout << "How many assignments are there? " << endl;
cin >> n;
for ( int i= 0 ; i <= n; i++ )
{
//input the total points earned for assignment
cout << "What is the score earned for this assignment? " ;
cin >> s;
//input the number of points assignment is worth
cout << "How many points was the assignment worth? " ;
cin >> t;
//calculate percentage
p = ( s / t) * 100 ;
}
//output score
cout .setf ( ios:: fixed ) ;
cout .setf ( ios:: showpoint ) ;
cout .precision ( 2 ) ;
cout << "Total score: " << p << "%" << endl;
return 0 ;
}
CiNpbmNsdWRlPGlvc3RyZWFtPgojaW5jbHVkZTx2ZWN0b3I+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSAKewogICAgCiAgICBmbG9hdCBzOyAgLy8gYXNzaWdubWVudCBzY29yZQogICAgZmxvYXQgdDsgIC8vIHRvdGFsIHBvaW50cyB3b3J0aAogICAgZmxvYXQgcDsgIC8vIHBlcmNlbnRhZ2UgICAgIAogICAgaW50IG47CiAgICAKICAgIC8vaW5wdXQgdGhlIG51bWJlciBvZiBhc3NpZ25tZW50cwogICAgCiAgICBjb3V0IDw8ICJIb3cgbWFueSBhc3NpZ25tZW50cyBhcmUgdGhlcmU/ICIgPDwgZW5kbDsKICAgIGNpbiA+PiBuOwogICAgCiAgICAgICAgZm9yIChpbnQgaT0wOyBpIDw9bjsgaSsrKQogICAgICAgIHsKICAgIAogICAgICAgICAgICAKICAgIC8vaW5wdXQgdGhlIHRvdGFsIHBvaW50cyBlYXJuZWQgZm9yIGFzc2lnbm1lbnQKICAgIGNvdXQgPDwgIldoYXQgaXMgdGhlIHNjb3JlIGVhcm5lZCBmb3IgdGhpcyBhc3NpZ25tZW50PyAiOwogICAgY2luID4+IHM7CiAgICAKICAgICAKICAgIC8vaW5wdXQgdGhlIG51bWJlciBvZiBwb2ludHMgYXNzaWdubWVudCBpcyB3b3J0aAogICAgY291dCA8PCAiSG93IG1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