数学概念——I - 数论,线性方程
2015-08-22 16:05
260 查看
I - 数论,线性方程
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
The Sky is Sprite.
The Birds is Fly in the Sky.
The Wind is Wonderful.
Blew Throw the Trees
Trees are Shaking, Leaves are Falling.
Lovers Walk passing, and so are You.
................................Write in English class by yifenfei
View Code
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
The Sky is Sprite.
The Birds is Fly in the Sky.
The Wind is Wonderful.
Blew Throw the Trees
Trees are Shaking, Leaves are Falling.
Lovers Walk passing, and so are You.
................................Write in English class by yifenfei
#include <cstdio> using namespace std; int x,y; int gcd(int a,int b) { if(b==0) { x=1; y=0; return a; } else { int d=gcd(b,a%b); int r=x; x=y; y=r-(a/b)*y; return d; } } int main() { int a,b; while(scanf("%d%d",&a,&b)==2) { int d=gcd(a,b); if(d!=1) printf("sorry\n"); else { while(x<=0) { x=x+b; y=y-a; } printf("%d %d\n",x,y); } } return 0; }
View Code
相关文章推荐
- Injection of resource dependencies failed解决办法总结
- 5个数组Array方法: indexOf、filter、forEach、map、reduce使用实例
- 基本概念——类和对象
- 字符串常量与变量
- Qt 界面:窗口图标以及任务栏图标的设置
- POJ 3678 2-sat,基础题
- 邮箱跳转
- UI - 组合控件LTView(UILabel + UITextField)
- Lightoj 1140(数位DP)
- ODOO8 按钮权限更改(3)
- bson json区别
- bson json区别
- bson json区别
- bson json区别
- bson json区别
- bson json区别
- bson json区别
- bson json区别
- bson json区别
- bson json区别