LightOJ1214 Large Division
2024-09-05 22:01:32
/*
LightOJ1214 Large Division
http://lightoj.com/login_main.php?url=volume_showproblem.php?problem=1214 数论 同余定理 题意:大整数取余
*
*
*
*
*/ #include <cstdio>
#include <cstring>
using namespace std;
char s[];
int main()
{
int t;
scanf("%d",&t);
long long b;
for(int i=;i<=t;i++)
{
printf("Case %d: ",i);
getchar();
scanf("%s",s);
scanf("%lld",&b);
int n=strlen(s);
long long num=0LL;
for(int i=;i<n;i++)
{
if(s[i]=='-')
continue;
num=(num*10LL+s[i]-'')%b;
}
if(num==0LL)
printf("divisible\n");
else
printf("not divisible\n");
}
return ;
}
最新文章
- jquery实现tab切换完整代码
- Generics and Collection (1)
- tinyXML的用法,用于解析gpx文件
- Failed to execute goal on project MakeFriends: Could not resolve dependencie The POM for .chengpai.jtd:jtd-service-api:jar:1.0-SNAPSHOT is missing, no dependency information available
- eclipse+cdt+minGW (C/C++ 编译)
- openstack 使用cloud init 和 console-log, nbd或者libguestfs 获取VM中的硬件信息。
- JavaScript从入门到忘记
- MyEclipse10.7 10.6导出war文件报错 “SECURITY ALERT: INTEGERITY CHECK ERROR”
- linkin大话设计模式--代理模式
- js 对象及空对象或数组及空数组的判断与比较
- RSA 分段加解密【解决“不正确的长度”的异常】
- 国内高速Maven仓库
- C#取整函数Math.Round、Math.Ceiling和Math.Floor 【非原创,用来收藏,分享】
- Asp.Net StateServer实现共同域名下Session共享
- Zabbix使用总结
- Kubernetes(k8s)集群部署(k8s企业级Docker容器集群管理)系列目录
- awk和sed (十二)
- Hive时间函数笔记
- svn 操作字母的提示
- poj_2352 Treap
热门文章
- 【待解决】创建maven web工程报错
- Linux 定时任务的学习
- PHP 比 Java 的开发效率高在哪?
- javaBean为什么要implements Serializable
- [Database] 列出MSSQL所有数据库名、所有表名、所有字段名
- Wannafly挑战赛25 C 期望操作数 数学
- nginx配置访问密码,让用户输入用户名密码才能访问
- Spark Scala语言学习系列之完成HelloWorld程序(三种方式)
- Solr.NET快速入门(七)【覆盖默认映射器,NHibernate集成】
- mybatis 高级映射和spring整合之高级映射(4)