NL
Nguyễn Lê Phước Thịnh
6 tháng 1 2023
const fi='chuso.inp'; fo='chuso.out';var f1,f2:text; i,n:integer; a:array[1..100] of integer;//chuongtrinhconfunction dai(x:integer)var st:string; d:integer;beginstr(x,st);d:=length(st);dai:=d;end;//chuongtrinhconfunction tong(x:integer)var i,n,d,t,y:integer; st:string;begin str(x,st); d:=length(st); t:=0; for i:=1 to d do begin val(st[i],n,y); t:=t+n; end; tong:=t;end;//chuongtrinhchinhbeginassign(f1,fi); reset(f1);assign(f2,fo); rewrite(f2);readln(f1,n);for i:=1 to n do read(f1,a[i]);for i:=1 to n do writeln(f2,dai(a[i]),' ',tong(a[i])); close(f1); close(f2);end.
Đúng(0)