Forgotten password

Language

Bulgarian    English

Advertisements




Report a bug !
Add search function to you browser

Powered by PHP Powered by MySQL
Pascal емулатор
1 member(s) online
Size control Print  Language: Pascal

Examples://Code arrange


To solve the problem you should shift the code with your mouse to end up with working solution.

Problem:
Write a program which inputs a integer positive four-digit number N and K and defines if K consist in N.


  • else
  • k : byte;
  • write ('Enter n= ');
  • readln (n);
  • write (‘Enter k= ’);
  • end
  • else write('No')
  • begin
  • readln(k);
  • a, b, c, d : byte;
  • var n : integer;
  • d := (N div 10) mod 10;
  • begin
  • if (n<1000)or(N>9999)or (k<0) or (k>9) then write ('Error')
  • c := (N div 100) mod 10;
  • if (a=k) or (b=k) or (c=k) or (d=k) then write('Yes')
  • b := N mod 10;
  • a := N div 1000;
  • end.