回覆列表
-
1 # 我是你的小公聚
-
2 # 使用者551921813817
#include
#include
#include
void main()
{
char str[80];
int i;
int j = 0;
int nFlag = 0;
int count = 0;
int a[20];
scanf("%s", str);
for (i = 0; i
{
if (str[i] >= "0" && str[i]
{
count++;
a[j] = atoi(str + i);
j++;
nFlag = 1;
}
else
{
nFlag = 0;
}
}
if (count == 0)
{
printf("None\n");
}
printf("%d ", count);
for (i = 0; i
{
printf("%d ", 2 * a[i]);
}
}
#include <stdio.h>#include <string.h>#include <stdlib.h>void main(){ char str[80]; int i; int j = 0; int nFlag = 0; int count = 0; int a[20]; scanf("%s", str); for (i = 0; i < strlen(str); i++) { if (str[i] >= "0" && str[i] <= "9" && nFlag == 0) { count++; a[j] = atoi(str + i); j++; nFlag = 1; } else { nFlag = 0; } } if (count == 0) { printf("None\n"); } printf("%d ", count); for (i = 0; i < j; i++) { printf("%d ", 2 * a[i]); }}