10進数の'10'を、プログラム内の変数a,b,cにそれぞれ10進数、8進数、16進数で代入し、表示せよ。変数a,b,cのデータ型はどうすればよいか?
#include <iostream> using namespace std; int main(){ int a=10, b=012, c=0xa; cout << "a=" << a << ", b=" << b << ", c="<< c << "\n"; return 0;}
このページへのコメント
AkfpKi I truly appreciate this blog.Really looking forward to read more. Will read on...