我有这样的模式:
pattern = "Delivered to %(recipient)s at %(location)s"
如何根据此模式获取字符串的recipient
和location
?
例如:Delivered to Mr.Smith at Seattle
将被提取到[Mr.Smith,Seattle]
。
因此,我希望任何匹配此模式的字符串都会像这样提取这两个参数。
答案 0 :(得分:2)
#include <stdio.h>
int main(void)
{
double s;
int a;
scanf("%lf%d", &s, &a);
if (_________________ )
__________________
_________________
_________________
else
__________________
__________________
________________
__________________
return 0; }