Darmowe Forum
Kwiecień 29, 2024, 20:09:10 *
Witamy, Gość. Zaloguj się lub zarejestruj.
Czy dotarł do Ciebie email aktywacyjny?

Zaloguj się podając nazwę użytkownika, hasło i długość sesji
Aktualności: Forum zostało uruchomione!
 
   Strona główna   Pomoc Zaloguj się Rejestracja  
Strony: [1]
  Drukuj  
Autor Wątek: Pętla do {...} while(warunek)  (Przeczytany 2156 razy)
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« : Kwiecień 08, 2013, 11:13:11 »

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{ int a=0,b=0,c,d;
do { a++;cout<<endl<<endl; b=0;
do {b++;cout.width(3);cout<<a*b;} while(b<5);

}while(a<5);
   
    cout<<endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}
Zapisane
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« Odpowiedz #1 : Kwiecień 08, 2013, 11:27:06 »

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{ int a=0,b=0,c,d;
do { a++;cout<<endl<<endl; b=0;
do {b++;
if(((a*b)%7)==0){cout.width(4);cout<<"X";} else
{cout.width(4);cout<<a*b;};} while(b<10);

}while(a<10);
   
    cout<<endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}
Zapisane
Strony: [1]
  Drukuj  
 
Skocz do:  

Powered by SMF 1.1.11 | SMF © 2006-2008, Simple Machines LLC | Sitemap

Polityka cookies
Darmowe Fora | Darmowe Forum

elita-mam 3wojna shakesifidget testdomta slimrpg