SHARE
    TWEET
    AlexAvram

    Untitled

    Jun 5th, 2025
    209
    0
    Never
    Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
    C++ 0.62 KB | None | 0 0
    1. //#1860 BlackFriday
    2. #include <fstream>
    3. using namespace std;
    4. ifstream fin("blackfriday.in");
    5. ofstream fout("blackfriday.out");
    6. int main()
    7. {
    8. int n, pret1[11], pret2[11];
    9. fin>>n;
    10. for (int i=1; i<=n; ++i)
    11. fin>>pret1[i];
    12. for (int i=1; i<=n; ++i)
    13. fin>>pret2[i];
    14. int dif, indice;
    15. double procent, procent_max=-1;
    16. for (int i=1; i<=n; ++i)
    17. {
    18. dif=pret1[i]-pret2[i];
    19. procent=(dif*100)/pret1[i];
    20. if (procent>procent_max)
    21. {
    22. procent_max=procent;
    23. indice=i;
    24. }
    25. }
    26. fout<<indice;
    27. return 0;
    28. }
    Advertisement
    Add Comment
    Please, Sign In to add comment
    Public Pastes
    We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
    Not a member of Pastebin yet?
    Sign Up, it unlocks many cool features!

    AltStyle によって変換されたページ (->オリジナル) /