Uses crt; var i,ans:integer; s:string; u:set of char; begin read(s); for i:=1 to length(s) do if not(s[i] in u) then begin inc(ans); u:=u+[s[i]]; end; writeln(ans); end.
В шарпе чисто на switch сделать практически нереально. static String getAgeStatus(int age) { int type = 6; if (age < 1) type = 1; if ((age >= 1) && (age <= 11)) type = 2; if ((age >= 12) && (age <= 15)) type = 3; if ((age >= 16) && (age <= 25)) type = 4; if ((age >= 26) && (age <= 70)) type = 5; switch (type) { case 1:return "младенец"; case 2: return "ребенок"; case 3: return "подросток"; case 4: return "юноша"; case 5: return "мужчина"; default: return "пожилой человек"; } }
// PascalABC.NET 3.0, сборка 1157 от 02.02.2016 begin var n:=ReadInteger('n='); if n<0 then Writeln(n,'! не определено: n<0') else if n=0 then Writeln('0!=1') else begin var p:BigInteger:=1; for var i:=2 to n do p*=i; Writeln(n,'!=',p) end end.
var i,ans:integer;
s:string;
u:set of char;
begin
read(s);
for i:=1 to length(s) do
if not(s[i] in u) then begin
inc(ans);
u:=u+[s[i]];
end;
writeln(ans);
end.