?? 6_10.cpp
字號(hào):
//6_10.cpp
#include <iostream>
using namespace std;
void splitfloat(float x, int *intpart, float *fracpart)
//形參intpart,fracpart是指針
{
*intpart=int(x); //取x的整數(shù)部分
*fracpart=x-*intpart; //取x的小數(shù)部分
}
void main()
{
int i,n;
float x,f;
cout<<"Enter 3 float point numbers:"<<endl;
for(i=0;i<3;i++)
{
cin>>x;
splitfloat(x,&n,&f); //變量地址作為實(shí)參
cout<<"Integer Part="<<n<<" Fraction Part="<<f<<endl;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -