题目 1009: [编程入门]数字的处理与判断
摘要:解题思路:1. 通过循环去掉最后一位,同时让计数加 2.通过循环将数字的每一位放入数组,再遍历输出。注意事项:参考代码:#include<stdio.h>//建立数组int w[10];int ……
求最大公约数和最小公倍数
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int m, n,min=1,max=1,i; cin >……
输出数字位数,并按位输出,再逆序输出。
摘要:解题思路:注意事项:参考代码:void main(){ int a; int i=0,divisor = 10; int array[5]; int trunNum = 0; ……
1009: [编程入门]数字的处理与判断
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int num = 0; cin >> num; s……
此题运用了stl中的vector容器
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ vector<int>v1; int num; cin>>n……
利用递归求解数字的处理与判断
摘要:解题思路:首先须知,在c++中:1、当一个整数/10时,不会产生小数。即int/int != float。例如:123/10=12,而不是12.32、当一个整数%10时,产生的数是该数的末位。即:12……