C++ setw 출력이 이상한데
조회수 384회
제 노트북(맥)에서는
include
include
include
using namespace std;
int main(){
double grade=3.500;
cout<<setw(12)<<"학과:"<<setw(15)<<"컴퓨터공학과"<<endl;
cout<<setw(12)<<"학점:"<<setw(15)<<fixed<<setprecision(1)<<grade<<endl;
cout<<setw(12)<<"이름:"<<setw(15)<<"\"홍길동\""<<endl;
return 0;
}
이렇게 입력하면 컴퓨터공학과랑 "홍길동" 이 부분만 setw 적용이 안 된 상태로 칸수가 안 맞게 나오더라고요ㅠㅠ 근데 또 다른 친구 노트북에서 돌리면 제대로 출력된다고 하는데 왜 이럴까여...
댓글 입력