simplify read process using the return value of scanf

This commit is contained in:
Oliver Lew
2018-06-02 19:00:10 +08:00
parent 3b9871c632
commit b18a408a2c
+3 -7
View File
@@ -56,13 +56,9 @@ int Rev(int N, int D)
int main()
{
int N, D;
scanf("%d", &N);
while(N >= 0)
{
scanf("%d", &D);
while(scanf("%d %d", &N, &D) == 2)
puts(iPrime(N) && iPrime(Rev(N, D)) ? "Yes" : "No");
scanf("%d", &N);
}
return 0;
}