Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float tab[3];
- int main()
- {
- for (int i = 0; i < 3; i++){
- cout << "wprowadz " << i+1 << " liczbe: " << endl;
- cin >> tab[i];
- }
- for (int j = 0; j < 2; j++){
- for (int i = 0; i < 2; i++){
- if (tab[i] > tab[i+1]){
- float x = tab[i];
- tab[i] = tab[i+1];
- tab[i+1] = x;
- }
- }
- }
- cout << endl;
- cout << "liczby w poprawnej kolejnosci to: " << endl;
- for (int i = 0; i < 3; i++){
- cout << tab[i] << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment