diff --git a/uppdev/Jasa/Jasa.cpp b/uppdev/Jasa/Jasa.cpp index d03ed7cf6..e1a74e97c 100644 --- a/uppdev/Jasa/Jasa.cpp +++ b/uppdev/Jasa/Jasa.cpp @@ -2,17 +2,39 @@ using namespace Upp; +String ReadString(const char *txt) +{ + Cout() << txt; + return ReadStdIn(); +} + +int ReadInt(const char *txt = "") +{ + return StrInt(ReadString(txt)); +} + +double ReadDouble(const char *txt = "") +{ + return StrDbl(ReadString(txt)); +} + + CONSOLE_APP_MAIN { - for(;;) { - String s = ReadStdIn(); - if(s.GetLength() == 0) - break; - int a = atoi(s); - s = ReadStdIn(); - int b = atoi(s); - Cout() << a << '+' << b << '=' << a + b << '\n'; - Cout() << a << '-' << b << '=' << a - b << '\n'; - Cout() << a << '*' << b << '=' << a * b << '\n'; - } +pocitani: + int l = 1; + int a = ReadInt("Zadej cislo: "); + for(int i = 1; i <= a; i++) { + l=l*i; + Cout() << l << '\n'; + } + Cout() << l << '\n'; + goto pocitani; } + +/* +1*1 = 1 +1*2 = 2 +2*3 = 6 +6*4 = 24 +*/ \ No newline at end of file diff --git a/uppdev/Jasa/Jasa.upp b/uppdev/Jasa/Jasa.upp index cdfae135a..bce42d5f5 100644 --- a/uppdev/Jasa/Jasa.upp +++ b/uppdev/Jasa/Jasa.upp @@ -1,9 +1,9 @@ -uses - Core; - -file - Jasa.cpp; - -mainconfig - "" = ""; - +uses + Core; + +file + Jasa.cpp; + +mainconfig + "" = ""; + diff --git a/uppdev/Jasa/init b/uppdev/Jasa/init new file mode 100644 index 000000000..9502156e3 --- /dev/null +++ b/uppdev/Jasa/init @@ -0,0 +1,4 @@ +#ifndef _Jasa_icpp_init_stub +#define _Jasa_icpp_init_stub +#include "Core/init" +#endif