每日一题--20200406--将用户输入的由数字字符和非数字字符组成的字符串中的数字提取出来

编写一个程序,将用户输入的由数字字符和非数字字符组成的字符串中的数字提取出来(例如:输入asd123,34fgh_566kkk789,则产生的数字分别是123、34、789)。

输入格式要求:提示信息:“Please enter a string:”
输出格式要求:“the result of output:\n” "%10****d
\n"
程序运行示例如下:
Please enter a string:
abc123def456ghi111bbbccc99go100
the result of output:
123
456
111
99
100

注意事项:格式!!按格式输出太难;99前面是有空一格的

#include 
#include 
int main ( )
{
   
    printf("Please enter a string:");
    char arr[100];
    char* a = arr;
    scanf("%s",arr);
    printf("the result of output:\n");
    int b = 0,c = 0,d = 0;
    for(int i = 0;i < strlen(arr);i++)
    {
   
        
        if(

你可能感兴趣的:(c语言题,c语言每日一道练习题,字符串,c语言)