c++设计一个函数,将年/月/日的格式表示的时间转换为年-月-日
c++设计一个函数,将年/月/日的格式表示的时间转换为年-月-日
日期:2021-07-25 05:00:53 人气:1
#include<stdio.h>
// convert / to -:
char *ymd(char *s){
int i;
for (i=0;i<strlen(s);i++)if (s[i]=='/')s[i]='-';
return s;
}
main()
{
char y[]="2015/05/09&
// convert / to -:
char *ymd(char *s){
int i;
for (i=0;i<strlen(s);i++)if (s[i]=='/')s[i]='-';
return s;
}
main()
{
char y[]="2015/05/09&