64,654
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
char s[17]="X-00.32 Y+00.03";
float x,y;
int main() {
if (2==sscanf(s,"X%f%*[ \t]Y%f",&x,&y)) {
printf("X,Y==%g,%g\n",x,y);
} else {
printf("Format error:%s\n",s);
}
return 0;
}
//X,Y==-0.32,0.03
//