Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- //problema 3
- /* unsigned long n,i=0,nr=0,x,maxi=0;
- cout<<"n=";cin>>n;
- while (i<n)
- {
- cin>>x;
- if (x>maxi)
- {
- maxi=x;
- nr=0;
- }
- // maxi=x;
- if (maxi==x)
- nr++;
- i++;
- }
- cout<<nr;//*/
- //problema 2
- /* int n;
- long double i=0,p,maxi=0;
- cout<<"n=";cin>>n;
- while (i<n)
- {
- cin>>p;
- if (p>maxi)
- maxi=p;
- i++;
- }
- cout<<maxi;//*/
- //pb1
- /* unsigned long n,uc,nr=0,i=1,d=2,eprim=1,x;
- cout<<"n=";cin>>n;
- while (i<=n)
- {
- cin>>x;
- uc=x%10;
- nr=nr*10+uc;
- i++;
- }
- while (d<=nr/2)
- {
- if (nr%d==0)
- eprim=0;
- d++;
- }
- if (eprim)
- cout<<"DA";
- else
- cout<<"NU";//*/
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement