Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- /*int abs(int h) { //wartość bezwzględna
- if (h < 0)
- return h*(-1);
- return h;
- }*/
- /*int wieksza(int a, int b)
- {
- if (a > b)
- return a;
- else
- return b;
- }*/
- /*int wiekabs(int a, int b)
- {
- if (abs(a) > abs(b))
- return abs(a);
- else
- return abs(b);
- }*/
- /*int wiekabs(int a, int b)
- {
- a = abs(a);
- b = abs(b);
- if (a > b)
- return a;
- else
- return b;
- }*/
- /*void piszTab(int tabl[], int n)
- {
- //int tab = { 5,9,8,7,4,5,6,7,8,9,4,5,3,5 };
- //int n = 14;
- for (int i = 0; i < n; i++)
- {
- printf("%d ", tabl[i]);
- }
- }*/
- int nwd(int x,int y)
- {
- while (x != y)
- {
- if (x > y)
- x = x - y;
- else
- y = y - x;
- }
- return y;
- }
- int main()
- {
- /*int tab[] = { 5,8,8,7,4,5,6,7,8,9,4,5,3,5 };
- piszTab(tab, 14);*/
- int a, b, c;
- printf("podaj a");
- scanf("%d", &a);
- printf("podaj b");
- scanf("%d", &b);
- printf("podaj c");
- scanf("%d", &c);
- printf("%d\n",nwd( nwd(a, b),c));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement