git-svn-id: svn://ultimatepp.org/upp/trunk@5487 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2012-10-28 13:02:01 +00:00
parent 52390a4532
commit b0baef4e1a
3 changed files with 46 additions and 20 deletions

View file

@ -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
*/

View file

@ -1,9 +1,9 @@
uses
Core;
file
Jasa.cpp;
mainconfig
"" = "";
uses
Core;
file
Jasa.cpp;
mainconfig
"" = "";

4
uppdev/Jasa/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _Jasa_icpp_init_stub
#define _Jasa_icpp_init_stub
#include "Core/init"
#endif