getchar():字符輸入函數(shù)
作用:從終端(或系統(tǒng)隱含指定的輸入設(shè)備)輸入一個字符。此函數(shù)沒有參數(shù)
putchar():字符輸出函數(shù)
作用:向終端輸出一個字符。此函數(shù)需要傳一個參數(shù)
#include<iostream>
using namespace std;
int main(){char c;
c = getchar(); putchar(c+32);putchar('\n');
return 0;}
程序在運行時,如果從鍵盤輸入大寫字母‘A’,并按回車鍵,就會在屏幕上輸出小寫字母a