私信TA
用户名:YogSothoth
访问量:32860
签 名:
琪露诺的编程教室
自我简介:
⑨的智慧天下无敌!
作者: YogSothot 发表时间:2017-12-28 21:05:45 浏览:686 | 评论:0
解题思路:注意事项:很多人表示看不懂,因为这个其实是用数学的方法来解决,如果数学不好的还是直接背下来吧。。。参考代码:
#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;
int main()
{
int n,m=3,s=0;
cin>>n;
for(int i=2;i<=n;i++)
s=(s+m)%i;
cout<<s+1<<endl;
}
0.0分
0 人评分
看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:
编程语言转换
万能编程问答
代码解释器
代码纠错
SQL生成与解释