SHARE
TWEET

Bài 1 Ôn HK1

anhkiet2507 Dec 9th, 2018 10,090 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int arr[5];
  7.     int i;
  8.     int max;
  9.     for (i = 1; i <= 5; i++)
  10.     {
  11.         cout << "Nhap vao phan tu thu " << i << " cua mang: ";
  12.         cin >> arr[i];
  13.     }
  14.     max = arr[1];
  15.     for (i = 1; i <= 5; i++)
  16.     {
  17.         if (arr[i] > max)
  18.         {
  19.             max = arr[i];
  20.         }
  21.     }
  22.     cout << "So lon nhat la: " << max << endl;
  23.     system("pause");
  24.     return 0;
  25. }
RAW Paste Data
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
 
Top