Let’s call left cyclic shift of some string 𝑡1𝑡2𝑡3…𝑡𝑛−1𝑡𝑛 as string 𝑡2𝑡3…𝑡𝑛−1𝑡𝑛𝑡1. Analogically, let’s call right cyclic shift of string 𝑡 as string 𝑡𝑛𝑡1𝑡2𝑡3…𝑡𝑛−1. Let’s say st
答案: #include <stdio.h> int pow(int a, int b) //定义一个a的b次方函数{int m = 1;int i = 0;for (i = 0; i < b; i++) //b次方{m = (m * a) % 1000; // %1000用来控制最后输出为后三位,同时每次乘法结果取模,避免溢出 }return m; //返回后三位数}