Advertisement
Guest User

wwa

a guest
Nov 20th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.67 KB | None | 0 0
  1. // Zad1.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <math.h>
  7. #include <cstdlib>
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     unsigned int n, m, k,i;
  13.     int x;
  14.     int wielo=0;
  15.     int silnia = 1;
  16.     cout << "Podaj wartosc n: ";
  17.     cin >> n;
  18.     cout << "Podaj wartosc m: ";
  19.     cin >> m;
  20.     cout << "Podaj wartosc k: ";
  21.     cin >> k;
  22.  
  23.     for (x = 1; x <= n; x++) {
  24.         silnia *=x;
  25.    
  26.        
  27.         }
  28.     cout << "Silnia z n: " << silnia << endl;
  29.         for (i = 1; i <= 50; i++) {
  30.             wielo += n;
  31.             if (wielo > m && wielo < k) {
  32.                 cout << "Wielokrotnosc n wieksza od m i mniejsza od k: " << wielo << endl;
  33.             }
  34.         }
  35.  
  36.  
  37.  
  38.    
  39.    
  40.         system("PAUSE");
  41.     return 0;
  42. }
  43.  
  44.  
  45. #include "stdafx.h"
  46. #include <iostream>
  47. using namespace std;
  48.  
  49. int main()
  50. {
  51.     unsigned int n;
  52.     int suma =0;
  53.     cout << "Podaj liczbe n: ";
  54.     cin >> n;
  55.     for (int i = 0; i <= n; i++) {
  56.         suma += i*i;
  57.         cout << "Suma wynosi: " << suma << endl;
  58.     }
  59.  
  60.  
  61.     system("PAUSE");
  62.     return 0;
  63. }
  64.  
  65. #include "stdafx.h"
  66. #include <iostream>
  67. #include <cstdlib>
  68. using namespace std;
  69.  
  70. int main()
  71. {
  72.      int n;
  73.     int i;
  74.     int iloczyn = 1;
  75.     cout << "Podaj liczbe wieksza od 2: ";
  76.     cin >> n;
  77.     if (n > 2) {
  78.         for (i = 2; i <= n; i = i + 2) {
  79.             iloczyn *= i;
  80.  
  81.         }
  82.  
  83. #include "stdafx.h"
  84. #include <iostream>
  85. #include <cstdlib>
  86. using namespace std;
  87.  
  88. int main()
  89. {
  90.     int n,m;
  91.    
  92.     int iloczyn = 1;
  93.     cout << "Podaj liczbe n: ";
  94.     cin >> n;
  95.     cout << "Podaj liczbe m: ";
  96.     cin >> m;
  97.  
  98.     if (n < m) {
  99.         for (int i = n; i <= m; i = i++) {
  100.             iloczyn *= i;
  101.  
  102.         }
  103.  
  104.  
  105.         cout << "Iloczyn wynosi: " << iloczyn << endl;
  106.         system("PAUSE");
  107.         return 0;
  108.  
  109.  
  110.     }
  111.     if (n <= 2) {
  112.         return 0;
  113.     }
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement