witam napisałem prosty program w c++ który wypisuje a>b>c czy mógłby mi ktoś powiedzieć czy algorytm jest dobry i co musze wpisać w ify w schemacie blokowym jestem laikiem ale nie chce dostać 1 w szkole za jakąś głupote
#include "stdafx.h"
#include <iostream.h>
#include <conio.h>
int main(int argc, char* argv[])
{
int a, b, c;
cout << "podaj a:";
cin >> a;
cout << "podaj b:";
cin >> b;
cout << "podaj c:";
cin >> c;
if (a>b)
cout << a << " jest wieksze od " << b << endl;
else
cout << a << " jest mniejsze lub rozne od " << b <<endl;
{if (b>c)
cout << b << " jest wieksze od " << c << endl;
else
cout << b << " jest mniejsze lub rozne od " << c <<endl;
}
{if (a>c)
cout << a << " jest wieksze od " << c << endl;
else
cout << a << " jest mniejsze lub rozne od " << c <<endl;
}
getch();
return 0;
a tu schemat blokowy http://img274.imageshack.us/my.php?image=atb8.png
#include "stdafx.h"
#include <iostream.h>
#include <conio.h>
int main(int argc, char* argv[])
{
int a, b, c;
cout << "podaj a:";
cin >> a;
cout << "podaj b:";
cin >> b;
cout << "podaj c:";
cin >> c;
if (a>b)
cout << a << " jest wieksze od " << b << endl;
else
cout << a << " jest mniejsze lub rozne od " << b <<endl;
{if (b>c)
cout << b << " jest wieksze od " << c << endl;
else
cout << b << " jest mniejsze lub rozne od " << c <<endl;
}
{if (a>c)
cout << a << " jest wieksze od " << c << endl;
else
cout << a << " jest mniejsze lub rozne od " << c <<endl;
}
getch();
return 0;
a tu schemat blokowy http://img274.imageshack.us/my.php?image=atb8.png