2020年2月7日 星期五
利用輸入ctrl-z按enter來跳出while回圈
//利用輸入ctrl-z按enter來跳出while回圈
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int lower_case_count=0;//counter
char ch;
while(cin >> ch)
{
if(ch >='a' && ch <= 'z')
lower_case_count++;
}
cout << "lower case count:" << lower_case_count << endl;
system("PAUSE");
return 0;
}
訂閱:
張貼留言 (Atom)
algorithm
#include <iostream> #include <string.h> using namespace std; int main(int argc, char** argv) { for(int j=2;j<=100;j++)//j...
-
https://knightkasim.pixnet.net/blog/post/150323886
-
#include <at89x52.h> #define key_start 0x40//按鍵 用P3.6按鍵開始 #define key_pause 0x80// 探按兩下暫停 int P2table[]={0x80,0x40,0x20,0x10,0x08...

沒有留言:
張貼留言