Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- II
- 2.
- #include<iostream.h>
- #include<conio.h>
- int main()
- {float b,c,d,e,f,g;
- unsigned a;
- cout<<"Cate materii ai";cin>>a;
- b=0;c=0;e=0;d=0;f=0;
- while(b!=a)
- {
- g=c;
- cout<<"Scrie nota";cin>>c;
- d+=c;
- if(c>g)
- {
- f=c;
- }
- b++;
- }
- e=d/a;
- cout<<float(e)<<endl;
- cout<<f;
- getch();
- }
- 3.
- #include <iostream.h>
- #include <conio.h>
- int main()
- {unsigned a,b,c,d,e;
- c=0;e=0;
- a=32;
- cout<<"Introdu n:";cin>>d;
- while(c!=d)
- {
- cout<<"Introdu numarul:";cin>>b;
- if(b%3==0)
- {
- cout<<"\nNumarul este prim:";
- cout<<b<<endl;
- e+=1;
- }
- else if(b%3!=0)
- {
- cout<<"\nNumar neprim:";
- cout<<b<<endl;
- }
- c++;
- }
- cout<<"\nNumere prime:"<<e;
- getch();
- }
- Daca o sa le fac si pe celelalte va anunt.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement