OJ problem 1005
来源:互联网 发布:android app 端口号 编辑:程序博客网 时间:2024/06/07 13:17
这是杭电OJ上面的1005,网址点击,
周期定义为48!
#include<iostream>using namespace std;int f(int a,int b,int n){if(n==1||n==2)return 1;elsereturn (a*f(a,b,n%48-1)+b*f(a,b,n%48-2))%7;}int main(){int a,b,n;while(cin>>a>>b>>n){if(a==0&&b==0&&n==0)break;cout<<f(a,b,n)<<endl;}return 0;}
- OJ problem 1005
- OJ problem 1004
- OJ---3n+1 Problem
- Light oj 1070 - Algebraic Problem
- Tongji OJ Problem A - A
- 第十六周 OJ:Money Problem
- OJ 4之Maze Problem
- HDU-OJ Problem - 1042 N!
- A+B Problem && OJ推荐
- A+B Problem (sdut oj)
- Swust OJ 004 Maze Problem
- oj刷题 Problem J: 软件工程
- oj Problem C: 查找【数组】
- Fafu OJ A+B Problem
- OJ text1 A+B Problem
- HDU OJ 1001 Sum Problem
- 命令提示OJ Problem 566
- Light OJ 1102 Problem Makes Problem 组合数
- 如何成为一个C++高级程序员
- Visual Studio 2012使用OpenGL辅助库的问题解决方案
- “三点估算法”出题的形式演化分析
- ofbiz的webservice接口提供(4)-支持复杂数据类型方法
- ofbiz的webservice接口提供(2)-数据类型的局限性
- OJ problem 1005
- ofbiz的webservice接口提供(1)-WSDL的生成
- 【黑马程序员】File.ReadAllLines(错误)
- ofbiz和应用服务器结合
- PHP课堂--实验5
- 程序员面试宝典_程序设计基本概念
- 广度优先搜索
- hdu2717
- struts 2 的SessionAware接口使用