Advertisement
MeehoweCK

Untitled

Mar 8th, 2024
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main() {
  4.     int liczba;
  5.     std::cout << "Podaj 10 liczb calkowitych: ";
  6.     std::cin >> liczba;
  7.     auto najwieksza{ liczba };
  8.     for (auto i{ 1 }; i < 10; ++i) {
  9.         std::cin >> liczba;
  10.         if (liczba > najwieksza) {
  11.             najwieksza = liczba;
  12.         }
  13.     }
  14.     std::cout << "Najwieksza wczytana liczba wynosi " << najwieksza << std::endl;
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement