Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#1860 BlackFriday
- #include <fstream>
- using namespace std;
- ifstream fin("blackfriday.in");
- ofstream fout("blackfriday.out");
- int main()
- {
- int n, pret1[11], pret2[11];
- fin>>n;
- for (int i=1; i<=n; ++i)
- fin>>pret1[i];
- for (int i=1; i<=n; ++i)
- fin>>pret2[i];
- int dif, indice;
- double procent, procent_max=-1;
- for (int i=1; i<=n; ++i)
- {
- dif=pret1[i]-pret2[i];
- procent=(dif*100)/pret1[i];
- if (procent>procent_max)
- {
- procent_max=procent;
- indice=i;
- }
- }
- fout<<indice;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement