C++代码string库函数,输入空格终止问题,采用getline 摘要:解题思路:https://www.cnblogs.com/Alan-kx/p/14320284.html读取空格终止导致for循环无法遍历全字符串问题注意事项:暂时不明参考代码:#include<io…… 题解列表 2021年12月28日 0 点赞 0 评论 651 浏览 评分:0.0
c语言巧妙解答(小白) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ char a[1001]; char b[1001]; gets(a); g…… 题解列表 2021年12月28日 1 点赞 0 评论 453 浏览 评分:0.0
c++处理,利用do-while循环解决 摘要:解题思路:(1)先想好怎么计算出位数?利用do-while循环指令,将输入的数分别除以十,得到余数和商,判断商是否为0;不是0则继续循环; do { b[i] = a % 10; a…… 题解列表 2021年12月28日 0 点赞 0 评论 790 浏览 评分:0.0
数对直接输出结果 摘要:解题思路:注意事项:参考代码:a=int(input())for i in range(1,a+1): if a%i==0: print(str(i)+" * "+str(int(…… 题解列表 2021年12月28日 0 点赞 0 评论 465 浏览 评分:0.0
使用set来统计数 摘要:解题思路:注意事项:参考代码:a=int(input())b=input().split()m=[]for i in range(0,len(b)): m.append(int(b[i]))n=…… 题解列表 2021年12月28日 0 点赞 0 评论 409 浏览 评分:0.0
C++宏定义求余数 摘要:解题思路:#define remainder a%b注意事项:暂时不明参考代码:#include<iostream>#include<string>using namespace std;#defin…… 题解列表 2021年12月28日 0 点赞 0 评论 755 浏览 评分:0.0
C++代码带实参宏定义 摘要:解题思路:#define s(a,b,c) ((a+b+c)/2)#define area(a,b,c,s) sqrt(s(a,b,c)*(s(a,b,c)-a)*(s(a,b,c)-b)*(s(a,…… 题解列表 2021年12月28日 0 点赞 0 评论 450 浏览 评分:0.0
数组查找和替换 摘要:解题思路:注意事项:参考代码:a=input()m=int(a.split()[0])n=int(a.split()[1])x=[]c=input().split()for i in range(0,…… 题解列表 2021年12月28日 0 点赞 0 评论 434 浏览 评分:0.0
C++代码宏定义闰年判断 摘要:解题思路:四年一闰;百年不闰,四百年再闰if ((y%4==0) and (y%100!=0) or (y%400==0)) cout<<'L'<<endl;else cout<<&#…… 题解列表 2021年12月28日 0 点赞 0 评论 429 浏览 评分:0.0
整除问题直接分离数字循环判断 摘要:解题思路:注意事项:参考代码:a=input()min=int(a.split()[0])max=int(a.split()[1])factor=int(a.split()[2])for i in r…… 题解列表 2021年12月28日 0 点赞 0 评论 452 浏览 评分:0.0