Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 21.11.17pp_kolo_lab.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <array>
- #include <vector>
- #include <string>
- using namespace std;
- bool czyTrojkat(int a, int b, int c) {
- if ((a + b > c) && (a + c > b) && (b + c > a)) {
- return true;
- }
- else {
- return false;
- }
- }
- int podajLiczby() {
- return 0;
- }
- void zadanie1() {
- cout << "podaj 3liczby" << endl;
- int a, b, c;
- cin >> a >> b >> c;
- cout<< czyTrojkat(a,b,c);
- }
- int najmniejsza() {
- array<int, 20> tab;
- for (int i = 0; i < 20; i++)
- {
- cout << "podaj liczbe" << endl;
- int a;
- cin >> a;
- tab[i] = a;
- }
- int mini = 99999;
- for (int i = 0; i < 20; i++) {
- if (tab[i] < mini)
- {
- mini = tab[i]; }
- }
- return mini;
- }
- int najwieksza() {
- vector <int> wektor;
- for (int i = 0; i < 20; i++)
- {
- cout << "podaj liczbe" << endl;
- int a;
- cin >> a;
- wektor.push_back(a);
- }int maxi = 0;
- for (int i = 0; i < 20; i++) {
- if (wektor[i] > maxi)
- {
- maxi = wektor[i];
- }
- }
- return maxi;
- }
- void asciiNazwisko() {
- string nazwisko;
- cin >> nazwisko;
- char litera;
- int ascii;
- for (int i = 0; i < nazwisko.size(); i++)
- {
- litera=nazwisko[i];
- ascii = litera;
- if (ascii%2 = 0) {
- cout << nazwisko[i];
- }
- }
- }
- int main()
- {
- //zadanie1();
- //cout<<najmniejsza();
- //cout<< najwieksza();
- asciiNazwisko();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement