Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <ctime>
- #include <conio.h>
- #include <stdlib.h>
- #include <cstdlib>
- #include <dos.h>
- #include <windows.h>
- #include <time.h>
- #include <unistd.h>
- #include <cstdio>
- using namespace std;
- int wybor;
- void zmiana();
- void wypisanie();
- void ile();
- void szukaj();
- void zamien();
- void szyk();
- void moja_funkcja()
- {
- cout << "[1] - Zmiana tekstu na duże litery" << endl;
- cout << "[2] - Wypisanie tekstu TheBest" << endl;
- cout << "[3] - Ile slow jest w zdaniu" << endl;
- cout << "[4] - Szukaj znaku" << endl;
- cout << "[5] - Zamiana znaku" << endl;
- cout << "[6] - Zmiana szyku w zdaniu" << endl;
- wybor=getch();
- if(wybor=='1')
- {
- zmiana();
- }
- if(wybor=='2')
- {
- wypisanie();
- }
- if(wybor=='3')
- {
- ile();
- }
- if(wybor=='4')
- {
- szukaj();
- }
- if(wybor=='5')
- {
- zamien();
- }
- if(wybor=='6')
- {
- szyk();
- }
- }
- void zmiana()
- {
- system("cls");
- string napis;
- cout << endl << "Podaj ciag znakow: ";
- getline(cin, napis);
- cout << endl << "Wpisales: " << napis;
- cout << endl << "Dlugosc: " << napis.size();
- cout << endl << "Powiekszony: " ;
- int i=0;
- char c;
- while (napis[i])
- {
- c=napis[i];
- putchar (toupper(c));
- i++;
- }
- cout << endl << "Zamieniony: QWEYTR" ;
- int n;
- cin >> n;
- while ( n > 0 ) {
- i = n % 10;
- if (i != 0){
- n /= 10;
- cout << i << endl;
- } else
- n /= 10;
- }
- }
- void wypisanie()
- {
- system("cls");
- system("COLOR FC");
- string a;
- cout << endl << "Wpisz slowo: ";
- getline(cin, a);
- int x;
- x=a.size();
- cout << endl << "Wpisz slowo: " << x << endl;
- int b;
- for(b=0;b<x;b++)
- {
- cout << "TheBest";
- }
- }
- void ile()
- {
- system("cls");
- system("COLOR BC");
- int z=1;
- string napis;
- cout << endl << "Podaj ciag znakow: ";
- getline(cin, napis);
- int l=napis.length();
- for (int i=0; i<l ; i++)
- {
- if (napis[i]==' ')
- z++;
- }
- cout << "Ilosc wyrazow: " << z <<endl;
- }
- void szukaj()
- {
- cout << "jeszcze nic" << endl;
- }
- void zamien()
- {
- cout << "jeszcze nic" << endl;
- }
- void szyk()
- {
- cout << "jeszcze nic" << endl;
- }
- int main()
- {
- cout << "W programie sa nastepujace opcje:" << endl;
- moja_funkcja();
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement