import java.io.*; /** * 公式法直接解决。 */ public class Main { public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); public static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); public static StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); public static PrintWriter cout = new PrintWriter(new OutputStreamWriter(System.out)); static int f(int n){ if(n==1){ return 0; } else{ return (f(n-1)+3)%n; } } public static void main(String[] args) throws Exception { cin.nextToken(); int n = (int) cin.nval; cout.print(f(n) + 1); cout.flush(); } }
0.0分
1 人评分
Minesweeper (C语言代码)浏览:805 |
C二级辅导-分段函数 (C语言代码)浏览:566 |
C二级辅导-同因查找 (C语言代码)浏览:564 |
简单的a+b (C语言代码)浏览:760 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:652 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:511 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:559 |
C语言程序设计教程(第三版)课后习题7.1 (C语言代码)浏览:515 |
简单的a+b (C语言代码)浏览:599 |
printf基础练习2 (有点不明白)浏览:845 |