求助Dalao!!!写完之后把思路忘光光了QAQ,根本看不懂自己滴程序~~~ 大佬能来挑挑毛病吗
程序附上:
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
using namespace std;
int n, s = 0, temp;
int main ()
{
scanf ("%d", &n);
int a[n], b[n];
for (int i = 0; i <= n; i++)
a[i] == i + 1;
for (int i = 0; i <= n; i++)
b[i] = a[i];
for (int i = 0; i <= n; i++)
{
int y = 0, m = 0;
temp = b[i];
while (! b[i] < 10)
y ++;
b[i] /= 10;
s += b[i];
while (m != y)
{
b[i] *= 10;
s += b[i];
}
}
printf ("%d\n", s);
return 0;
}
C++的,在线求助 2024/9/6