Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. // 21.11.17pp_kolo_lab.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <array>
  7. #include <vector>
  8. #include <string>
  9. using namespace std;
  10.  
  11. bool czyTrojkat(int a, int b, int c) {
  12. if ((a + b > c) && (a + c > b) && (b + c > a)) {
  13. return true;
  14. }
  15. else {
  16. return false;
  17. }
  18.  
  19. }
  20. int podajLiczby() {
  21.  
  22.  
  23. return 0;
  24. }
  25. void zadanie1() {
  26. cout << "podaj 3liczby" << endl;
  27. int a, b, c;
  28. cin >> a >> b >> c;
  29. cout<< czyTrojkat(a,b,c);
  30.  
  31. }
  32.  
  33.  
  34. int najmniejsza() {
  35. array<int, 20> tab;
  36. for (int i = 0; i < 20; i++)
  37. {
  38. cout << "podaj liczbe" << endl;
  39. int a;
  40. cin >> a;
  41. tab[i] = a;
  42. }
  43. int mini = 99999;
  44. for (int i = 0; i < 20; i++) {
  45. if (tab[i] < mini)
  46. {
  47. mini = tab[i]; }
  48.  
  49. }
  50. return mini;
  51. }
  52. int najwieksza() {
  53. vector <int> wektor;
  54. for (int i = 0; i < 20; i++)
  55. {
  56. cout << "podaj liczbe" << endl;
  57. int a;
  58. cin >> a;
  59. wektor.push_back(a);
  60. }int maxi = 0;
  61. for (int i = 0; i < 20; i++) {
  62. if (wektor[i] > maxi)
  63. {
  64. maxi = wektor[i];
  65. }
  66.  
  67. }
  68. return maxi;
  69.  
  70. }
  71.  
  72. void asciiNazwisko() {
  73. string nazwisko;
  74. cin >> nazwisko;
  75. char litera;
  76. int ascii;
  77. for (int i = 0; i < nazwisko.size(); i++)
  78. {
  79. litera=nazwisko[i];
  80. ascii = litera;
  81. if (ascii%2 = 0) {
  82. cout << nazwisko[i];
  83. }
  84. }
  85. }
  86.  
  87. int main()
  88. {
  89. //zadanie1();
  90. //cout<<najmniejsza();
  91. //cout<< najwieksza();
  92. asciiNazwisko();
  93. return 0;
  94.  
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement