Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Zad1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <math.h>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- unsigned int n, m, k,i;
- int x;
- int wielo=0;
- int silnia = 1;
- cout << "Podaj wartosc n: ";
- cin >> n;
- cout << "Podaj wartosc m: ";
- cin >> m;
- cout << "Podaj wartosc k: ";
- cin >> k;
- for (x = 1; x <= n; x++) {
- silnia *=x;
- }
- cout << "Silnia z n: " << silnia << endl;
- for (i = 1; i <= 50; i++) {
- wielo += n;
- if (wielo > m && wielo < k) {
- cout << "Wielokrotnosc n wieksza od m i mniejsza od k: " << wielo << endl;
- }
- }
- system("PAUSE");
- return 0;
- }
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- unsigned int n;
- int suma =0;
- cout << "Podaj liczbe n: ";
- cin >> n;
- for (int i = 0; i <= n; i++) {
- suma += i*i;
- cout << "Suma wynosi: " << suma << endl;
- }
- system("PAUSE");
- return 0;
- }
- #include "stdafx.h"
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int n;
- int i;
- int iloczyn = 1;
- cout << "Podaj liczbe wieksza od 2: ";
- cin >> n;
- if (n > 2) {
- for (i = 2; i <= n; i = i + 2) {
- iloczyn *= i;
- }
- #include "stdafx.h"
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int n,m;
- int iloczyn = 1;
- cout << "Podaj liczbe n: ";
- cin >> n;
- cout << "Podaj liczbe m: ";
- cin >> m;
- if (n < m) {
- for (int i = n; i <= m; i = i++) {
- iloczyn *= i;
- }
- cout << "Iloczyn wynosi: " << iloczyn << endl;
- system("PAUSE");
- return 0;
- }
- if (n <= 2) {
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement