Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "Hello world!" << endl;
- int t[10];
- //feltöltés
- int i=0;
- while(i<10){
- cin>>t[i];
- i++;
- }
- i=0;
- while(i<10){
- cout<<endl<<i+1<<". elem:"<<t[i]<<endl;
- i++;
- }
- //keresések
- int db=0;
- i=0;
- while(i<10){
- if(t[i]%2==0){
- db++;
- }
- i++;
- }
- cout<<"paros:"<<db<<endl;
- i=0;
- double osszeg=0;
- while(i<10){
- osszeg+=t[i];
- i++;
- }
- cout<<"osszeg: "<<osszeg<<endl;
- double atlag;
- atlag=osszeg/i;
- cout<<"atlag="<<atlag;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment