我是靠谱客的博主 酷酷唇膏,这篇文章主要介绍c++输入带分隔符,现在分享给大家,希望可以做个参考。

#include   <iostream> 
#include   <cstdlib> 
//是赋值以逗号为分隔符
using   namespace   std; 

int   main() 
{ 
        int   a,b,c; 
        cin>> a;cin.ignore(1, ', '); 
        cin>> b;cin.ignore(1, ', '); 
        cin>> c;cin.ignore(1, ', '); 
        cout <<a <<endl; 
        cout <<b <<endl; 
        cout <<c <<endl; 
        system( "pause "); 
        return   0; 
}   

最后

以上就是酷酷唇膏最近收集整理的关于c++输入带分隔符的全部内容,更多相关c++输入带分隔符内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(95)

评论列表共有 0 条评论

立即
投稿
返回
顶部