program n1; uses crt; var a,b,c,x: integer; beginclrscr; writeln('vvedite chislo'); readln(x); a: =x div 100; c: =x mod 10 ; b: =x div 10 mod 10; if a=0 then writeln('chislo ne trehznachnoe! ') else writeln(c,b,a); readlnend.
2) или через string
program n1; uses crt; var a: string; beginclrscr; writeln('vvedite chislo'); readln(a); if length(a)> 3 then writeln('oshibka') elsewriteln(a[3],a[2],a[1]); readlnend.
microsoft visual basic 2010(более ранние тоже прокатят)
dim i as single private sub form1_load(byval sender as system.object, byval e as system.eventargs) handles mybase.load i = val(inputbox("введите число")) if i > = 0 then i = i - 50 else i = i + 100 end if msgbox(i) end sub
просто на basic
dim i as single
input(i)
if i > = 0 then i = i - 50 else i = i + 100 end if
Популярные вопросы