//程序还不没有完善
#include<stdio.h>
#include<windows.h>
#include<stdlib.h>
#include<math.h>
#pragma warning(disable:4996)
void Graphical()
{
int i = 1;
for (; i <= 12; i++)
{
int j = 1;
for (; j <= i; j++)
{
printf("*");
}
i++;
printf("\n");
}
int m = 13;
for (; m >= 0; m--)
{
int j = 1;
for (; j <= m; j++)
{
printf("*");
}
m--;
printf("\n");
}
}
int Narcissistic()
{
int i = 0;
for (;i <= 999; i++)
{
double na = pow(((i%100)/10),3)+pow((i / 100), 3) + pow((i % 10), 3);
if (na == i)
{
printf("%d ", i);
}
}
printf("\n");
return 0;
}
int number(int n)
{
int result = 12345 * n;
printf("a+aa+aaa+aaaa+aaaaa= %d", result);
return 0;
}
int main()
{
//1.图形
Graphical();
//2.求出0〜999之间的所有“水仙花数”并输出。
printf("0-999中的水仙花数有:");
Narcissistic();
//3.求Sn = a + aa + aaa + aaaa + aaaaa的前5项之和,其中a是一个数字
int a = 0;
printf("please enter a\n");
scanf("%d", &a);
number(a);
system("pause");
}