Advertisement
Qpel

3užd

Dec 20th, 2016
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.     int M[10];
  9.  
  10.     for(int i = 0; i < 10; i++){
  11.         cout << i << ". ";
  12.         cin >> M[i];
  13.     }
  14.  
  15.     int didz = 0, ididz;
  16.  
  17.     for(int i = 0; i < 10; i++){
  18.         if(didz < M[i]){
  19.             didz = M[i];
  20.             ididz = i;
  21.         }
  22.     }
  23.  
  24.     cout << "Didziausias masyvo narys = " << didz << ", jo indeksas = " << ididz;
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement