Created
May 24, 2017 04:36
-
-
Save TPAKC/2f232d81d47ba14f6473a5542891f3fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program Project2; | |
var | |
c: char; | |
f: text; | |
a,rem1,rem2: integer; | |
begin | |
assign(f, 'nine.in'); | |
reset(f); | |
rem1 := 0; | |
while not eoln(f) do | |
begin | |
read(f, c); | |
rem1 := (rem1 + ord(c) - ord('0')) mod 9; | |
end; | |
readln(f); | |
rem2 := 0; | |
while not eoln(f) do | |
begin | |
read(f, c); | |
rem2 := (rem2 + ord(c) - ord('0')) mod 9; | |
end; | |
readln(f); | |
a := rem1 * rem2; | |
close(f); | |
assign(f, 'nine.out'); | |
rewrite(f); | |
if a mod 9 = 0 then | |
write(f, 'YES') | |
else | |
write(f, 'NO'); | |
close(f); | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment