高精度求模(同余定理)

版权声明:emmmmm喵喵喵 https://blog.csdn.net/MallowFlower/article/details/89787423
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e2;
int high(string s,const int &mod){
	int ans = 0;
	for(int i=0;i<s.length();i++){
		ans = (ans*10+s[i]-'0')%mod;
	}
	return ans;
}
int main(){
	string s;
	cin>>s; 
	cout<<high(s,mod)<<endl;
	return 0;
} 

猜你喜欢

转载自blog.csdn.net/MallowFlower/article/details/89787423
今日推荐