Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int arr[5];
- int i;
- int max;
- for (i = 1; i <= 5; i++)
- {
- cout << "Nhap vao phan tu thu " << i << " cua mang: ";
- cin >> arr[i];
- }
- max = arr[1];
- for (i = 1; i <= 5; i++)
- {
- if (arr[i] > max)
- {
- max = arr[i];
- }
- }
- cout << "So lon nhat la: " << max << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement