例子2.4

#include<iostream>
using namespace std;
int main(){
 float x;
 int i;
 x=3.6;
 i=(int)x;
 cout<<"x="<<x<<",i="<<i<<endl;
 return 0;
}

原文地址:https://www.cnblogs.com/sanyeai/p/7519123.html