luyencode / comments

Server lưu trữ bình luận trên Luyện Code
https://luyencode.net
6 stars 3 forks source link

https://oj.luyencode.net/problem/INSPIRE #882

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Thuyền trưởng Roxana - Luyện Code Online

https://oj.luyencode.net/problem/INSPIRE

phamminhhieupc commented 1 year ago

var n,i,t,tg,j:byte; s,a:string; min:real; begin readln(n); s:='ABCDEFGHIJKLMNOPQRSTUVWXYZ '; s:=s+''''; for j:=1 to n do begin readln(a); upcase(a); min:=0; for i:=2 to length(a) do begin tg:=abs(pos(a[i],s)-pos(a[i-1],s)); if tg=0 then min:=min+1 else begin if tg<=28-tg then t:=tg else t:=28-tg; min:=min+(((60pi)/28)t)/15+1; end; end; writeln(min+1:0:4); end; end.
đây là code pascal đã ac