Jul 22

无聊的scanf 不指定

felix021 @ 2011-7-22 16:36 [IT » 程序设计] 评论(1) , 引用(0) , 阅读(6885) | Via 本站原创 | |
#include <stdio.h>

int main()
{
    int a, b;
    scanf("%d%*[, ]%d", &a, &b);
    printf("%d + %d = %d\n", a, b, a + b);
    return 0;
}

<= 1 2
=> 1 + 2 = 3

<= 1,2
=> 1 + 2 = 3

<= 1 , 2
=> 1 + 2 = 3



欢迎扫码关注:




转载请注明出自 ,如是转载文则注明原出处,谢谢:)
RSS订阅地址: https://www.felix021.com/blog/feed.php
xayljq Email
2011-7-27 20:12
是挺无聊的。
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   *非必须
网址   电邮   [注册]