From c5fcf7179a83ef65c86c6a4a390029149e518649 Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Tue, 5 Oct 2021 21:49:54 +0200 Subject: Duzy commit ze smieciami --- semestr-4/sieci/warsztaty8/185992.cpp | 117 ++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 semestr-4/sieci/warsztaty8/185992.cpp (limited to 'semestr-4/sieci/warsztaty8/185992.cpp') diff --git a/semestr-4/sieci/warsztaty8/185992.cpp b/semestr-4/sieci/warsztaty8/185992.cpp new file mode 100644 index 0000000..491f748 --- /dev/null +++ b/semestr-4/sieci/warsztaty8/185992.cpp @@ -0,0 +1,117 @@ +#include +using namespace std; + +void dziesiatki ( int x); +void sety ( int x); + +string od1do9[]= { "zero", "jeden", "dwa", "trzy", "cztery", "piec", "szesc", "siedem", "osiem", "dziewiec"}; +string od10do19[]= { "dziesiec", "jedenascie", "dwanascie", "trzynascie", "czternascie", "pietnascie", "szesnascie", "siedemnascie", "osiemnascie", "dziewietnascie"}; +string od20do90[]= {"", "dwadziescia", "trzydziesci", "czterdziesci", "piecdziesiat", "szescdziesiat", "siedemdziesiat", "osiemdziesiat", "dziewiecdziesiat"}; +string od200do900[]= { "", "dwiescie", "trzysta", "czterysta", "piecset", "szescset", "siedemset", "osiemset", "dziewiecset"}; + +void miliony ( int x) { + if ( x==1) { + cout<<"milion "; + return; + } + dziesiatki(x); + if ( ( x >= 2 && x<=4) || ( x%10 >= 2 && x%10<=4) ) { + cout<<"miliony "; + return; + } else { + cout<<"milionow "; + return; + } + +} + +void tysiace ( int x) { + if ( x==1) { + cout<<"tysiac "; + return; + } + if ( x==100) { + cout<<"sto tysiecy"; + return; + } + if ( x<10) { + if ( x<=4) { + cout<=10 && x<=99) { + dziesiatki(x); + if ( x%10>=2 && x%10<=4) { + cout<<"tysiece "; + return; + } + cout<<"tysiecy "; + return; + } + cout<=10 ) { + dziesiatki(x); + return; + } + if (x!=0 && x<10) { + cout<>n; + if ( n>=1000000) { + miliony ( n/1000000); + } + n=n%1000000; + if ( n>=1000) { + tysiace( n/1000); + } + n=n%1000; + sety (n); +} -- cgit v1.2.3