标签:style str log nbsp end include color std out
#include <iostream> int main() { int currVal = 0, val = 0; if (std::cin >> currVal) { int count = 1; while(std::cin >> val) { if (val == currVal) { ++count; }else { std::cout << currVal << "出现了 " << count << " 次" << std::endl; currVal = val; count = 1; } } std::cout << currVal << "出现了 " << count << " 次" << std::endl; currVal = val; count = 1; } return 0; }
标签:style str log nbsp end include color std out
原文地址:http://www.cnblogs.com/funnyweb/p/6213160.html