题解 | 添加逗号
添加逗号
https://www.nowcoder.com/practice/f51c317e745649c0900996fd3f683aed
#include <stdio.h>
#include <string.h>
int main()
{
char N[20]={0};
scanf("%s",N);
int a=strlen(N);
for(int i=0;i<a;i++)
{
printf("%c",N[i]);
if((a-i-1)%3==0&&i!=a-1)
printf(",");
}
return 0;
}
