fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. const char* wkt = "POLYGON((116.696777 40.253906,116.696777 39.374914,117.575769 39.374914,117.575769 40.253906,116.696777 40.253906))";
  7. double q,w,e,r,t,y,u,i,o,p;
  8. int x = sscanf(wkt,"POLYGON((%lf %lf,%lf %lf,%lf %lf,%lf %lf,%lf %lf))",
  9. &q,&w,&e,&r,&t,&y,&u,&i,&o,&p);
  10.  
  11.  
  12. cout << x<<endl;
  13. printf("POLYGON((%lf %lf,%lf %lf,%lf %lf,%lf %lf,%lf %lf))",q,w,e,r,t,y,u,i,o,p);
  14. return 0;
  15. }
Success #stdin #stdout 0s 4192KB
stdin
Standard input is empty
stdout
10
POLYGON((116.696777 40.253906,116.696777 39.374914,117.575769 39.374914,117.575769 40.253906,116.696777 40.253906))