我回归了!
前年7TN57那个号忘了ID了(我也不知道咋忘得)
步入正题:
<——————————————->
以前干了会网页(HTML+CSS+JS),C++基础,Python,ScratchToEXE等、、
>但不精
现在主攻C++,打算开个C++ 的club,不管怎样,先在这里挂着|审核
总之,就是分享一些自己知道的东西,欢迎一起交流沟通
#include <iostream>#include <cstdlib>#include <cstring>#include <string>using namespace std;template <typename T>inline const bool not_found(const char a[], const T n) {//n:_Radix if (n >= 10) { return true; } for (int i = 0; i < strlen(a); i++) { if ((a[i] - '0') >= n)return false; } return true;}static void solve(const char a[], const char b[], const char c[]) { static char* end = new char;//废串,static 避免 stack overflow,new很有必要 for (int i = 2; i <= 16; i++) { if (strtol(a, &end, i)*strtol(b,&end,i) == strtol(c, &end, i) && not_found(a,i) && not_found(b,i) && not_found(c,i)) { cout << i; end = NULL;//赋值NULL return; } } cout << 0; end = NULL;//赋值NULL return;}void exe() { char a[20], b[20], c[20];//以char,数值不能大于10的18次方 cin >> a >> b >> c; solve(a,b,c);//开始解决}int main() { exe();//启动 return 0;}
其实我没有离线!有事请留言,一般在两三小时内回复!
请登录之后再进行评论
暂没有数据
本页链接:
班级博客班级社群
#写人作文#
#议论文作文#
#观后感作文#
#高考作文#
#作文习作#
#中考作文#
#写景作文#
#写信范文#
#动物作文#
#叙事作文#
#想象作文#
#植物作文#
其实我没有离线!有事请留言,一般在两三小时内回复!