Advertisement
STANAANDREY

pro

Nov 21st, 2018
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. //problema 3
  7.  /* unsigned long n,i=0,nr=0,x,maxi=0;
  8. cout<<"n=";cin>>n;
  9.   while (i<n)
  10.   {
  11.       cin>>x;
  12.       if (x>maxi)
  13.       {
  14.         maxi=x;
  15.         nr=0;
  16.       }
  17.        // maxi=x;
  18.       if (maxi==x)
  19.         nr++;
  20.       i++;
  21.   }
  22. cout<<nr;//*/
  23. //problema 2
  24. /*  int n;
  25.   long double i=0,p,maxi=0;
  26.     cout<<"n=";cin>>n;
  27.     while (i<n)
  28.     {
  29.         cin>>p;
  30.         if (p>maxi)
  31.             maxi=p;
  32.         i++;
  33.     }
  34.  
  35. cout<<maxi;//*/
  36. //pb1
  37. /*    unsigned long n,uc,nr=0,i=1,d=2,eprim=1,x;
  38.  
  39.     cout<<"n=";cin>>n;
  40.  
  41.  
  42.    while (i<=n)
  43.    {
  44.        cin>>x;
  45.        uc=x%10;
  46.        nr=nr*10+uc;
  47.        i++;
  48.    }
  49.     while (d<=nr/2)
  50.     {
  51.         if (nr%d==0)
  52.         eprim=0;
  53.         d++;
  54.  
  55.     }
  56.      if (eprim)
  57.         cout<<"DA";
  58.      else
  59.         cout<<"NU";//*/
  60.     return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement