判断p是否为素数且(a^p)%p是否等于a即可 #include <iostream> using namespace std; #define debug freopen("in.txt","r",stdin),freopen("out.txt","w",stdout); #define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); //#define PI&n...