DDD digital cryptocurrency
if it is not solved, you can contact the after-sales service station for detection
Example:
? Include & quot; stdio.h"
long int GetNum(int n, int d)
{
long int sum = 0;
int i;
for(i = 0; i < n; i++) {
sum *= 10;
sum += d;
}
return sum;
}
long int GetSum(int n, int d)
{
int i;
long int sum = 0;
for(i = 1; i <= n; i++) {
sum += GetNum(i, d);
}
printf(" Sum = %ld ", sum);
return sum;
}
void main()
{
int n, d;
printf(" Enter the maximum number of digits n: & quot;)
scanf("% d", & amp; n);
printf(" Enter the value D: & quot;)
scanf("% d", & amp; d);
GetSum(n ,d);
In C / C + + language, the fun function is usually called by the main function. It means to define a function (or method) with fun, so that it can be represented by fun in reference. For example, int fun (int x, int y), void fun (char * a, char * b) and so on. With the previous definition, you can call it in the main function, such as ans = fun (3,7); Or fun (P1, P2) There is no fun function inC / C + + standard library. The fun function is a user-defined function, which is used for example or syntax demonstration. You need to define the declaration before using it. The word "fun" has no special meaning. It can also be changed into other names, such as & quot; abc" Or & quot; ke"
it only refers to the function that appears before it is called to execute some requirements. Int fun (int x, int y) is just the function name of an example and the parameter type it declares
{
for (int i = 0; and < pArr> cnt; i+)
printf(" d" pArr> pbase(i);< br />printf("35; 92? n"< br />}
259130;
else
{
for (int i = 0; and < pArr> cnt; i+)
printf("% d ", pArr> pbase(i); //
printf("&35; 92? n"< br />}
#include < stdio.h > < br/>main()
{
longn,d,x,sum=0;
br/>scanf("% Can not open message amp; n, & d);< br/>x=d;< br/>while(n > 0){sum+=x; x=x*10+d; n--;}< br/>printf("% ld & #92; n ", < The following procere results: 51
12345
42
2468
43
3702
let AC be 37 and BC be? 7. Considering that the multiplication of two numbers is less than 1000, then& lt; 3. At the same time? If 7 is to be divisible by 3, it can only be 2. This is a set of solutions: 37 * 27 = 999, a + B + C + D = 3 + 2 + 7 + 9 = 21
let AC be 74, BC be? 4. If the multiplication of two numbers is less than 1000, then& lt; 2, but 14 is not divisible by 3, so this is not true
so a + B + C + D is 21
DDD is even, and the tens are the same, except 222 444 666 888
DDD is 222, then ABC = 111
444 ABC = 222
666 ABC = 333
888 ABC = 444
19 * 111 = 2109, f = 2, g = 1, H = 0, I = 9, a + B + C = a + D + e = 19
A = 3, B + C = D + e = 16, and there is no solution
when a = 4, B + C = D + e = 15; B = 7, C = 8, D and E have no solution
when a = 5, B + C = D + e = 14; B = 6, C = 8, D and E have no solution
when a = 6, B + C = D + e = 13; B = 5, C = 8, D and E have no solution
when a = 7, B + C = D + e = 12; B = 4, C = 8, D and E have no solution
when a = 8, B + C = D + e = 11; B=5,C=6,D=4,E=7
BC and de are interchangeable, B and C, D and E are interchangeable.
StringeL="[0-9]{3}-[0-9]{2}-[0-9]{5}";
Patternp=Pattern.compile(eL);
Stringtest="232-23-33333";
Matcherm=p.matcher(test);
booleandataFlag=m.matches();
if(!dataFlag){
System.out.println("格式错误");
}else{
System.out.println("格式正确");
}
使用正则判断