vertc

29-11

Dec 5th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     int tab[100],max=0;
  9.     srand( time( 0 ) );
  10.     for(int i=0; i<100; i++) {
  11.         tab[i]=rand()%80+20;
  12.         cout<<tab[i]<<" ";
  13.         if(tab[i]>max) {
  14.             max = tab[i];
  15.         }
  16.     }
  17.     cout<<"\n""Najwieksza liczba to: "<<max;
  18. return 0;
  19. }
  20.  
  21. -------------------------------------------------------------------------------------
  22.  
  23. #include <iostream>
  24. #include <string>
  25.  
  26. using namespace std;
  27.  
  28. int main() {
  29.     string Napis = "Raz, dwa, trzy, proba mikrofonu. ";
  30.     string Tekst = "Test";
  31.     cout<<Napis<<"\n"<<"Ilosc liter w powyzszym napisie wynosi "<<Napis.size();
  32.     Napis.append("Amen.");
  33.     Napis.insert(16, "cztery ");
  34.     cout<<"\n"<<Napis;
  35.     Napis.erase(0,40);
  36.     cout<<"\n"<<Napis;
  37. }
  38.  
  39. -------------------------------------------------------------------------------------
  40.  
  41. #include <iostream>
  42. #include <string>
  43.  
  44. using namespace std;
  45.  
  46. int main() {
  47.     string tab[3], Imie, Nazwisko, Wiek;
  48.     cout<<"Podaj imie: ";
  49.     cin>>Imie;
  50.     cout<<"Podaj nazwisko: ";
  51.     cin>>Nazwisko;
  52.     cout<<"Podaj wiek: ";
  53.     cin>>Wiek;
  54.     tab[1] = Imie+", "+Nazwisko+", "+Wiek;
  55.     cout<<tab[1];
  56.     cout<<"\n"<<"Ilosc liter wynosi: "<<tab[1].size();
  57. }
  58.  
  59. -------------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment