三部曲1: #include #include #include using namespace std; int main() { double a=0.0001; float b=0.1; int c=(int)(a*1000)/b; cout #inclu...
分类:
其他好文 时间:
2014-07-27 11:05:22
阅读次数:
180
C++结构体定义struct inflatable{ char name[20]; float volume; double price;}C++创建结构本:inflatable guest={ "Glorious Gloria", 1.88, 29.99};在C中是要加上struc...
分类:
编程语言 时间:
2014-07-26 14:25:00
阅读次数:
238
主函数结构:public class Atm_Demo{public static void main(String[] args){//执行语句;}}java的数据类型:java数据类型分为两种:基础数据类型和引用数据类型。其中基本数据类型包括:(数据型)byte,short,int,float,...
分类:
编程语言 时间:
2014-07-26 14:14:55
阅读次数:
224
首先看geeksforgeeks上的两个程序:
程序1:
#include
int main()
{
float x = 0.1;
if (x == 0.1)
printf("IF");
else if (x == 0.1f)
printf("ELSE IF");
else
printf("ELSE");
}
程...
分类:
其他好文 时间:
2014-07-26 03:03:46
阅读次数:
142
public class PxAndDp {
/**
* 根据手机的分辨率从 dp 的单位 转成为 px(像素)
*/
public static int dip2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
...
分类:
移动开发 时间:
2014-07-26 02:36:36
阅读次数:
276
#include
main()
{
float x,amax,amin;
scanf("%f",&x);
amax=x;amin=x;
while(x>=0)
{
if(x>amax)amax=x;
if(x<amin)amin=x;
scanf("%f",&x);
}
printf("\namax=%f\namin=%f\n",amax,amin);
}...
分类:
其他好文 时间:
2014-07-26 02:07:06
阅读次数:
179
#include
main()
{
int n,k;
float score,sum,ave;
for(n=1;n<3;n++)
{ sum=0.0;
for(k=1;k<=4;k++)
{scanf("%f",&score);
sum+=score;
}
ave=sum/4.0;
printf("NO%d:%f\n",n,ave);
}
}
sum=0.0的位置...
分类:
其他好文 时间:
2014-07-26 02:04:36
阅读次数:
201
1. 瞄准星 1 /**画瞄准星*/ 2 private void drawSight(){ 3 debugRenderer.begin(ShapeRenderer.ShapeType.Line); 4 float w = 50; 5 floa...
分类:
其他好文 时间:
2014-07-26 00:42:36
阅读次数:
212
inline-block/float(浮动) 回顾:inline-block 特性: 1、块在一排显示 2、内联支持宽高 3、默认内容撑开宽度 4、标签之间的换行间隙被解析(问题) 5、ie6 ie7不支持块属性标签的inline-block(问题) float浮动: 1、块在一排显示 ...
分类:
Web程序 时间:
2014-07-26 00:12:46
阅读次数:
383
1:基础数据与封装类型之间的转型
A:基础数据类型--->封装类型(对象类型)
Boolean boolean_1 = new Boolean(true);
byte ---->Byte
short---->Short
char---->Character
int--->Integer
long-->Long
float-->Float
double-->Double...
分类:
其他好文 时间:
2014-07-25 11:24:51
阅读次数:
210