9999999四舍五入到千位十位

把四位数x先四舍五入到十位,得到的数为y;然后四舍五入到百位,得的数为z;再四舍五入到千位,恰好是2000._百度知道
把四位数x先四舍五入到十位,得到的数为y;然后四舍五入到百位,得的数为z;再四舍五入到千位,恰好是2000.
则X的最大值与最小值的和是?
假设所有供恭垛枷艹磺讹委番莲都是舍去,那么最大是2444假设所有都是五入,那么最小是1445两数相加=89答案错了
其他类似问题
四舍五入的相关知识
其他3条回答
因为是四舍,所以最大值是2444;五入,所以最小值是1445;和是3889
一楼正解啊,为什么二楼说错了?
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Sqlplus /nolog
conn as sysdba
sele&&&&&&&&&&&&&&&&
//dual是一个空表
select 2*3&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//计算一个数学表达式
select cname,sal*12 as year_&&&&&&&&&&&&&
//计算年薪
select cname,sal*12 as “year_sal”&&&&&&&&&
//计算年薪,可以将year_sal保持小写
select ename||&&&&&&&&&&&&&&&&&&&&&&&&
//先将sal转换成字符串类型,然后ename字符串加上//sal的字符串
select sal||'test'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//sal转换成字符串然后在加上‘test
select ename||'test1''test2'&&&&&&&&&&&&&&&&&&&&&
//如果字符串里面本身就带有单引号,就可以用两//个单引号表示一个单引号
select dist&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//distinct去除重复数据
select distinct deptno,&&&&&&&&&&&&&&&&&&&&&&&&&&&
//去除deptno和job都一样的记录
select deptno from emp where deptno&& 10;&&&&&&&&&&
//deptno号不等于10的记录
select ename from emp where ename&'FDSA';&&&&&
//比较字符串大小,跟java中的字符串比较大//是一样的
select ename,sal from emp where sal between 800 and 1500;&&&&&&&&&&&
//工资位于800到1500之间,包括800和1500
select ename,sal from emp where sal&=800and sal&=1500;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
select ename,sal,comm from e&&&&&&&&&&&&&&&&&&&&&&&&
//选择comm是null的记录
select ename,sal,comm from emp w&&&&&&&&&&&&&&&&&
//选择comm不是null的记录
select ename,sal,comm from emp where sal in (800,);&&&&&&&&
//sal=800 or sal=3000 or //sal=1300
select ename,hiredate from emp where hiredate&'23-7月
-81';&&&&&&&&&& //日期过滤
select ename,sal from emp where sal not in (800,3000);&&&&&&&&&&&&&&&&&&&&&&&&&
select ename from emp where ename like '%ALL%';&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
select ename from emp where ename like '_A%';&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//A前面只有一个字母后面不限
select ename from emp where ename like '%\%%';&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//使用转义字符
select * from dept&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
select * from dept&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
select * from dept&
order bydeptno asc,
select lower(ename)&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//转换小写
select ename from emp where lower(ename) not like '_a%';
select ename from emp where ename like '_a%' or ename like'_A%';
select substr(ename,2,3)&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//从第二个开始共截取3个
select chr(65)&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//将数字转换成对应的字母
select ascii('A')&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//将字符转换成对应字母
select round(48.645)&&&&&&&&&&&&&&&&
//四舍五入
select round(48.645,2)&&&&&&&&&&&
//四舍五入到小数点后2位
select round(48.645,-1)&&&&&&&&&&
//四舍五入到十位结果:50
select to_char(sal,'$99,999.9999')&
//将sal转换成$1,600.0000样式
select to_char(sal,'L99,999.9999')&
//转换成本地货币¥
select to_char(hiredate,'YYYY-MM-DD HH:mm:ss')//格式化时间
select to_char(sysdate,'YYYY-MM-DD HH24:MM:SS')//HH24表示24小时形式
select ename,hiredate from emp where hiredate&to_date('2:12:12','YYYY-MM-DD HH24:MI:SS');
select ename,sal from emp wheresal&to_number('$1,250.00','$99,999.00');&&&&&&&&&&&&&&&
//to_number
select ename,sal*12+nvl(comm,0)&&&
//如果comm为null用0代替
select to_char(avg(sal),'')
max,min,avg,sum,count
select count(distinct deptno)
select deptno,job,max(sal) from emp group by deptno,
select ename from emp where sal=(select max(sal) from emp);
select deptno,max(sal) from//group中,如果某一个字段没有出现在函数里,那么该字段必须出现在group
select deptno,avg(sal) from emp group bydeptno having avg(sal)&1500;//having:对分组进行限制
select avg(sal) from emp where sal&1200group by deptno having avg(sal)&1500 order by avg(sal)&&&&&&&&&&&&&&
select ename from emp where sal&(selectavg(sal) from emp);
select ename,sal from emp
join (select max(sal) max_sal,deptno fromemp group by deptno) t
on (emp.sal=t.max_sal andemp.deptno=t.deptno);
//将(select
max(sal) max_sal,deptno from emp group by deptno)作为表t,条件是
//(emp.sal=t.max_sal
and emp.deptno=t.deptno)
select ename,dname from emp e,dept d wheree.deptno=d.
select ename,dname from emp e join dept don (e.deptno=d.deptno);
selectename,dname from emp join dept using(deptno);&&&&&&
//using:两个表的deptno字段相同
selectename,grade from emp e join salgrade s on (e.sal between s.losal and s.hisal);
selectename,dname,grade from emp e join dept d
on(e.deptno=d.deptno)
joinsalgrade s on (e.sal between s.losal and s.hisal)
whereename not like '_A%';
selecte1.ename,e2.ename from emp e1 left join emp e2 on (e1.mgr=e2.deptno);
//leftjoin会把左边e1中多余的(King:最高管理员)显示出来
selectename,dname from emp e right join dept d on (e.deptno=d.deptno);
//rightjoin:会把右边dept表中多余的(OPERATIONS)显示出来
selectename,dname from emp e full join dept d on (e.deptno=d.deptno);//full join:左右多余的记录都显示出来
--求部门平均工资的等级
selectdeptno,avg_sal,grade from
(selectdeptno,avg(sal) avg_sal from emp group by deptno) t
joinsalgrade s on (t.avg_sal between s.losal and s.hisal);
--求每个人的薪水等级
selectavg(sal) from
(selectdeptno,ename,grade from emp join salgrade s on (sal between s.losal ands.hisal)) t
--求每个部门的平均等级
selectt.deptno, avg(t.grade) from
(selectdeptno,ename,grade from emp join salgrade s on (sal between s.losal ands.hisal)) t
group byt.
--求哪些人是经理人
selectdistinct e2.empno,e2.ename from emp e1,emp e2 where e1.mgr=e2.
或者:select ename from emp where empno in (select distinct
mgr from emp);
--不用组函数,求薪水最高值
selecte.sal from emp e where e.sal not in (select distinct e1.sal from emp e1 join e
mp e2 one1.sal&e2.sal);
--求平均薪水值最高的部门的部门编号
selectt.deptno from (select deptno,avg(sal) avg_sal from emp group by deptno) t wher
et.avg_sal = (select max(avg(sal)) from emp group by deptno);
--求平均薪水值最高的部门的名称
selectdname from dept where deptno=( select t.deptno from (select deptno,avg(sal) avg_salfrom emp group by deptno) t where t.avg_sal
= (select max(avg(sal)) from empgroup by deptno));
--求平均薪水等级最低的部门的名称
select dname from dept d
join(select grade,t.deptno t_deptno from salgrade s
join(select avg(sal) avg_sal,deptno from emp group by deptno) t
on (t.avg_sal between s.losal and s.hisal)) xx
ond.deptno=xx.t_deptno and (xx.grade)=( select min(grade) from salgrade s
join(select avg(sal) avg_sal,deptno from emp group by deptno) t
on(t.avg_sal between s.losal and s.hisal));
--部门经理人中平均薪水最低的部门名称
select dname from dept d
join v$_mgr_avg_sal
on v$_mgr_avg_sal. MGR_AVG_SAL=(select min(v$_mgr_avg_sal.MGR_AVG_SAL) from v$_mgr_avg_sal) and d.deptno= v$_mgr_avg_sal.
--比普通员工最高薪水还要高的经理人名称
复杂的:select ename from emp e
join v$_max_common_emp_sal_info
on e.sal & (select common_emp_max_sal from v$_max_common_emp_sal_info);
select ename from emp
where empno in(select distinct mgr from emp where mgr is not null)
select max(sal) fromemp where empno not in
select distinct mgr from emp where mgr is not null
--删除用户
--将scott的数据复制给lipeng2用户
先在cmd命令行中进入c:/temp中
执行:del *.*&&
--删除所有文件
执行:exp&&&
输入用户名为:scott/tiger
然后一直按enter确定,最后导出到temp文件下
创建lipeng2用户(当然是用sys登录)
create user lipeng2identified by lipeng2 default tablespace users quota 10M
grant createsession,create table,create view to lipeng2;
create session用来登录的,没有该权限不能登录
还在刚才的cmd命令行中执行:
用lipeng2/lipeng2登录
输入用户名的时候输入scott,因为是只导入scott用户的信息,而导入文件中还可能会有其他人的导出信息。
--备份EMP表
create table emp2 asselect *
insert into dept2select *&&
--可以将dept中的数据全部插到dept2中
--显示第10条以后的记录
select ename from(select rownum r,ename from emp) where r&10;
select sname from s
on sc.sno=s.sno
o and c.cteacher&&’tea3’
create viewv$_stu_sc_info as select count(sc.sno) sc_nopass_count,sno from sc where
sc.scgrade&60
select distinct snamefrom s
join v$_stu_sc_infosc
on s.sno in (select snofrom v$_stu_sc_info where SC_NOPASS_COUNT &=2);
3.—即学过1号课程又学过2号课程的所有学生姓名
view v$_choice_course1_stu_info:select sno from sc,course o ame=’course1’;
view v$_choice_course2_stu_info:select sno from sc,course o ame=’course2’;
select sname from swhere sno in
(select t1.sno fromv$_choice_course1_stu_info t1
join (select sno fromv$_choice_course2_stu_info) t2
on t1.sno=t2.sno
--一个事务(transaction)起始于第一条dml语句,结束于commit或者rollback命令
或者执行ddl语句(创建表,更新表。。)
--断电的时候回滚
create table stu
id number(10),
name varchar2(20) constraint stu_name_nn not null,
sex number(1),
age number(3),
sdate date,
grade number(2) default 1,
clazz number(4),
email varchar2(50),
constraint stu_clazz_fk foreign key(clazz) references clazz(id),
constraint stu_id_pk primary key(id),
constraint stu_name_email_uni unique(email,name)
)&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
create table clazz
id number(4) primary key,
name varchar2(20) not null
alter table stu add(addr varchar2(100));
alter table stu drop(addr);
alter table stu modify(addr varchar(150));
alter table stu drop constraint stu_clazz_
alter table stu add constraint stu_class foreign key(clazz)references clazz(id);
查看用户下有多少张表
desc user_
select table_name from user_
查看用户下所有的视图
desc user_
select view_name from user_
查看所有约束
desc user_
select constraint_name,table_name from user_
user_tables,user_views,user_constraint都在distionary表里面
create index idx_stu_email on stu(email);
drop index idx_stu_
查看所有索引
select index_name from user_
创建sequence
select seq.
insert into stu(id) values(req.nextval);
dbms_output.put_line(‘helloworld!’);
如果要输入helloworld需要打开一个变量:即先执行:
然后执行上面的plsql
v_name varchar2(20);
v_name:='lipeng';
dbms_output.put_line(v_name);
v_temp number(1);
v_count binary_integer:=0;
v_sal number(7,2):=4000.00;
v_date date:=
v_pi constant number(3,2):=3.14;
v_valid boolean:=
v_name varchar2(20) not null:='lipeng';
dbms_output.put_line('v_temp value:'||v_temp);
--查看当前用户
show user;
--使用字段名%type可以和该字段类型相同
v_empno number(4);
v_empno2 emp.empno%
v_empno3 v_empno2%
dbms_output.put_line('test');
type type_table_emp_emono is table of emp.empno%type index by
&&&&& binary_
v_empnos type_table_emp_
v_empnos(0) := 7369;
v_empnos(1) := 7669;
v_empnos(-1) := 3434;
dbms_output.put_line(v_empnos(-1));
v_ename emp.ename%
v_sal emp.sal%
&select ename,sal into v_ename,v_sal from emp where empno=7499;
dbms_output.put_line(v_ename||' '||v_sal);
返回一行记录
v_emp emp%
select * into v_emp from emp where empno=7369;
dbms_output.put_line(v_emp.ename);
创建一个表
execute immediate 'create table t(nnn varchar2(20) default ''aaaa'')';
v_sal emp.sal%
select sal into v_sal from emp
where empno=7369;
if(v_sal&1200) then
dbms_output.put_line('low');
elsif(v_sal&2000) then
dbms_output.put_line('middle');
dbms_output.put_line('high');
循环1:相当于do-while循环
i binary_integer:=1;
dbms_output.put_line(i);
i:=i+1;
exit when(i&=11);
循环2:while循环
j binary_integer:=1;
while j&11 loop
dbms_output.put_line(j);
j:=j+1;
for k in 1..10 loop
dbms_output.put_line(k);
for k in reverse 1..10 loop
dbms_output.put_line(k);
游标cursor:
cursor c is
loop&&&&&&&&&&&&&
fetch c into v_
exit when (c%notfound);
dbms_output.put_line(v_emp.ename);
游标属性:notfound,found,rowcount
使用while方式循环游标
cursor c is
v_emp emp%
fetch c into v_
while(c%found) loop
dbms_output.put_line(v_emp.ename);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
fetch c into v_
使用for方式循环游标
cursor c is
for v_emp in c loop
dbms_output.put_line(v_emp.ename);
--带参数的游标
cursor c(v_deptno emp.deptno%type,v_job emp.job%type)
select ename,sal from emp where deptno=v_deptno and job=v_
for v_emp in c(30,'CLERK') loop
dbms_output.put_line(v_emp.ename);
--可更新的游标
创建存储过程:
create or replace procedure p
cursor c(v_deptno emp.deptno%type,v_job emp.job%type)
select ename,sal from emp where deptno=v_deptno and job=v_
for v_emp in c(30,'CLERK') loop
dbms_output.put_line(v_emp.ename);
执行存储过程:
--带参数的存储过程
create or replace procedure p
(v_a in number,v_b number,v_return out number,v_temp in out number)
if(v_a & v_b) then
v_return:=v_a;
v_return:=v_b;
v_temp:=v_temp+1;&
传入参数:
create or replace procedure p
(v_a in number,v_b number,v_return out number,v_temp in out number)
if(v_a & v_b) then
v_return := v_a;
v_return := v_b;
v_temp := v_temp + 1;
如果在创建存储过程的时候出现“警告:
创建的过程带有编译错误。”,执行:
show error
查看错误。
调用该存储过程
v_a number:=3;
v_b number:=4;
v_temp number:=5;
p(v_a,v_b,v_return,v_temp);
dbms_output.put_line(v_return);
dbms_output.put_line(v_temp);
&&&&&&&&&&&&&&&
创建函数:
create or replace function sal_tax
(v_sal number)
return number
if(v_sal&2000) then
return 0.10;
elsif(v_sal&2750) then
return 0.15;
return 0.20;
创建一个日志表:
create table emp2_log
uname varchar2(20),
action varchar2(10),
atime date
创建一个emp2的修改操作的日志触发器:
create or replace trigger trig
after insert or delete or update on emp2 for each row
if inserting then
insert into emp2_log values(USER, 'insert', sysdate);
elsif updating then
insert into emp2_log values(USER, 'update', sysdate);
elsif deleting then
insert into emp2_log values(USER, 'delete', sysdate);
执行一个插入emp2记录操作:
insert into emp2(empno,ename,job) values(100,'lipeng','test');
查看emp2_log记录:
update emp2 set sal = sal*2 where dateno = 30;
emp2_log中有6条记录被添加,如果把触发器中的
for each row去掉,只会有一条记录增加;
删除function,cursor,trigger都是:
如果直接执行:
update dept set deptno=99 where deptno=10;
会报错。解决方法:
create trigger trig_test
after update on dept for each row
update emp set deptno=:NEW.deptno where deptno=:OLD.
然后在执行就会正确;
create table article
id number primary key,
content varchar2(4000),
pid number,
isleaf number(1),--0
代表非叶子节点,1代表叶子节点
alevel number(2)
插入数据:
insert into article values(1,'蚂蚁大战大象',0,0,0);
insert into article values(2,'大象被打趴下了',1,0,1);
insert into article values(3,'蚂蚁也不好过',2,1,2);
insert into article values(4,'瞎说',2,0,2);
insert into article values(5,'没有瞎说',4,1,3);
insert into article values(6,'怎么可能',1,0,1);
insert into article values(7,'怎么没有可能',0,1,2);
insert into article values(8,'可能性是很大的',6,1,2);
insert into article values(9,'大象进医院了',2,0,2);
insert into article values(10,'护士是蚂蚁',9,1,3);
1蚂蚁大战大象
大象被打趴下了
蚂蚁也不好过
5&&&&&&&&&&&
大象进医院了
10&&&&&&&&&&&
护士是蚂蚁
怎么没有可能
可能性是很大的
create or replace procedure pp
(v_pid article.pid%type,v_level article.alevel%type)
cursor c is select * from article where pid=v_
v_preStr varchar2(1024):='';
for i in 1..v_level loop
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
v_preStr := v_preStr || '****';
for v_article in c loop
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
dbms_output.put_line(v_preStr||v_article.content);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
if(v_article.isleaf = 0) then
&&&&&&&&&&&&
pp(v_article.id,v_level+1);
exec pp(0,0);
Oracle中自动产生guid:
select sys_guid()
默认用户:
在浏览器中输入:
1158:Oracle Enterprise Manager的http端口号
em:Enterprise
Manager的简称
1.主机身份证明:
用户名:Dell&
(也就是计算机中名称)
密码:Window中Dell用户的登录密码
2.数据库身份证明:
用户名:sys
口令:lipeng
create table it_employees
employee_id number(6) not null unique,
first_name varchar2(20),
last_name varchar2(25) not null,
email varchar2(25),
phone_number varchar2(10),
job_id varchar2(10),
salary number(8,2),
manager_id number(6));
create view prog_employees
select employee_id,first_name,last_name,email,
phone_number,salary,manager_id
from it_employees
where job_id='IT_PROG';
create view prog_employees2
select employee_id,first_name,last_name,email,
phone_number,salary,manager_id
from it_employees
where job_id='IT_PROG'
create index it_lastname on it_employees(last_name);
对于经常更新的列,不宜建立聚簇索引
2. 在oracle数据库中,删除基表后建立在此表上的视图定义仍然保留在数据字典中,当用户引用该视图时会报错。
3. 删除表:drop table&table_name&
4. 删除视图:drop view&view_name&
drop view prog_
5. 删除索引:
drop index it_
更新表结构
ALTER TABLE&TABLE_NAME&
[ADD&新列名&&数据类型&[完整性约束]]
[DROP&完整性约束名&]
[MODIFY &列名&&数据类型&];
alter table it_employees add birth_
alter table it_employees modify manager_id number(8);
alter table it_employees drop unique(employee_id);
没有提供删除列的语句
selectdistinctfrom
selectfromwherelike'%B%'
selectfromwherelike'_A%'
select23from
selectsysdatefrom--
||字符串连接符
selectfrom
select'adsf''adf'from--中的两个单引号会输出一个单引号
IS NULL关键字(必须都要大写)
selectfromwhereISNULL
IS NOT NULL关键字(必须都要大写)
selectfromwhereIS NOTNULL
selectfromwherein80015002000
selectfromwherein'SMITH''ALLEN'
可以使用\作为转义字符
selectfromwherelike'%\%%'
LOWER(小写转换)
selectfrom
--查看第二个字母是a或者A的员工
selectfromwherelike'_a%'
UPPER(大写转换)
selectfrom
SUBSTRING(m,n)--从第m个字符开始截取,一共截取n个字符
select25from
CHR—将数字对应的ASCII码
select65from
ASCII—将ASCII码转换为对应的数字
select'A'from
ROUND—四舍五入
selectround(3.1415926)
select242from--四舍五入到小数点两位
select24.2531from--
四舍五入到十位
TO_CHAR—格式化数字
select'$99,999,999.999'from--美元
select'L99,999,999.999'from--L代表local,本地货币
TO_CHAR—格式化时间
select'YYYY-MM-DD'from
select'YYYY-MM-DD
HH:mm:ss'from
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:7534次
排名:千里之外
原创:38篇
转载:13篇
(5)(3)(12)(1)(1)(1)(2)(1)(1)(7)(13)(2)(2)编写程序,输入一个任意数(整数或小数),将该数四舍五入到十位并数出结果。_百度知道
编写程序,输入一个任意数(整数或小数),将该数四舍五入到十位并数出结果。
这是一道c语言的题目!,请大家帮帮忙!,谢谢喽!,帮我写出这个程序来
用c语言表示,过程具体些!,谢谢!
提问者采纳
,&x);%;printf(&%lf&scanf(&,x).1lf\n&quotmain(){double x
提问者评价
谢了,我也算出来了。呵呵
其他类似问题
其他3条回答
scanf(&c,&s);%d& 楼上的很好了呀; s=int(s%10)*10,呵呵,我写多了就删了其它的了: int s
0.ooooooooooooooooooooo99111
可惜,我用的是PASCAL
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁教师讲解错误
错误详细描述:
一个4位整数先四舍五入到十位,再把所得数四舍五入到百位,然后又把所得的数四舍五入到千位,这时的数为3×103,你能说出这个数的最大值和最小值吗?
电话:010-
地址:北京市西城区新街口外大街28号B座6层601
微信公众号
COPYRIGHT (C)
INC. ALL RIGHTS RESERVED. 题谷教育 版权所有
京ICP备号 京公网安备96230四舍五入到十位,百位,千位,万位,个是多少_百度知道
96230四舍五入到十位,百位,千位,万位,个是多少
我有更好的答案
按默认排序
.962.96.10
其他类似问题
四舍五入的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 四舍五入到千位 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信