不要只相信你的眼睛

变态的ACM题

袜子哥哥 posted @ Sep 19, 2012 08:10:33 PM in C with tags c 南洋理工 , 1055 阅读

http://acm.nyist.net/JudgeOnline/problem.php?pid=477

链接地址是南阳理工学院的一道语言入门题,我在作出如下判断后进行提交

if(c == (a + b)){
printf("Yes\n");
}
else{
printf("No\n");
}
结果是错误的
 
此题关键是实数在计算机内存储形式问题,如:1在计算机内部形式是0.99999·····

所以会产生小数点后精度的一点点偏差,导致程序出错!
 
正确的结果是:
#include <stdio.h>
int main(){
	int num = 0;
	double a = 0, b = 0, c = 0;
	scanf("%d", &num);
	
	while(num--){
		scanf("%lf %lf %lf", &a, &b, &c);
		if((a <= 10000.0) && (a >= -10000.0) 
           && (b <= 10000.0) && (b >= -10000.0)
           && (c <= 20000.0) && (c >= -20000.0))
		{
			if(((a + b) - c <= 0.00001) && ((a + b) - c >= -0.00001)){
				printf("Yes\n");
			}
			else{
				printf("No\n");
			}
		}
	}	
	return 0;
}

 

  • 无匹配
Avatar_small
依云 说:
Sep 19, 2012 10:17:20 PM

这不算变态的啦,看看这里的: http://evol128.is-programmer.com/posts/35602.html

seo service UK 说:
Jan 15, 2024 09:56:57 PM

Really impressed! Everything is very open and very clear clarification of issues. It contains truly facts. Your website is very valuable. Thanks for sharing.

먹튀스타 说:
Feb 18, 2024 07:37:33 PM

My personal sis advised me personally about your internet site and exactly how excellent it truly is. She’s proper, I’m genuinely amazed using the composing and clever style. Seems like to me you’re merely itching the surface in terms of that which you might accomplish, nevertheless you’re off to a terrific start!

먹튀사이트 说:
Feb 18, 2024 07:38:01 PM

Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post.Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work.

카지노를부탁해 说:
Feb 18, 2024 07:50:56 PM

Design Strategies for Tiny Females Covers together with nice knitted feel, laces, tiny flower prints as well as plaids ought to be provided choice.

안전토토사이트 说:
Feb 18, 2024 07:51:39 PM

Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post.Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work.

토토24 说:
Feb 18, 2024 07:52:18 PM

My personal sis advised me personally about your internet site and exactly how excellent it truly is. She’s proper, I’m genuinely amazed using the composing and clever style. Seems like to me you’re merely itching the surface in terms of that which you might accomplish, nevertheless you’re off to a terrific start!

먹튀검증커뮤니티 说:
Feb 18, 2024 08:55:18 PM

You possibly will not get glimmering results with an individual cleaning spiral. Thus, repeat a window cleaning up for several times unless you want to get the specified outcome. And also, you can pass the worry of cleaning up services to your professionals. Utilize window cleaning up services out of DIALAMAID to get effortless cleaning up and unsoiled windows.

먹튀마루 说:
Feb 18, 2024 08:56:13 PM

Quite a few online communities include singles sets which attempt enjoyable click here activities mutually, all this is actually is a good renewable dating approach. Incidents similar to pedaling, bowling, curling, video clip evenings, breaking a leg and comedy club sets tend to be organized with the singles group, but it enables a evenly-distributed group of objectives to have a great as well as laid-back nights. Together with emphasis apply to the actual activity themselves as an alternative to building a romantic connection, you will need plenty of demand journey singles in addition to sights manifest additional the natural way throughout this kind of environment.

토토지존 说:
Feb 18, 2024 08:57:02 PM

You possibly will not get glimmering results with an individual cleaning spiral. Thus, repeat a window cleaning up for several times unless you want to get the specified outcome. And also, you can pass the worry of cleaning up services to your professionals. Utilize window cleaning up services out of DIALAMAID to get effortless cleaning up and unsoiled windows.

먹튀폴리스보증업체 说:
Feb 18, 2024 09:26:43 PM

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good workYes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more.

온라인카지노 说:
Feb 18, 2024 09:27:09 PM

This design is spectacular! You obviously know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job. I really enjoyed what you had to say, and more than that, how you presented it. Too cool!

스포츠토토사이트 说:
Feb 18, 2024 09:27:44 PM

Hello, this weekend is good for me, since this time i am reading this enormous informative article here at my home.I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us.This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future...

먹튀검증업체 说:
Feb 18, 2024 09:33:16 PM

Quite a few online communities include singles sets which attempt enjoyable click here activities mutually, all this is actually is a good renewable dating approach. Incidents similar to pedaling, bowling, curling, video clip evenings, breaking a leg and comedy club sets tend to be organized with the singles group, but it enables a evenly-distributed group of objectives to have a great as well as laid-back nights. Together with emphasis apply to the actual activity themselves as an alternative to building a romantic connection, you will need plenty of demand journey singles in addition to sights manifest additional the natural way throughout this kind of environment.

먹튀검증커뮤니티 说:
Feb 18, 2024 09:34:00 PM

Now i am really fresh to wordpress blogs. however what you post on this site is absolutely very good and very beneficial. I believe it would help me in the future. Thanks for the excellent work.

메이저사이트추천 说:
Feb 18, 2024 09:40:09 PM

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good workYes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more.

먹튀사이트조회 说:
Feb 18, 2024 09:40:50 PM

Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future...Thanks for taking the time to discuss this, I feel strongly that love and read more on this topic.

먹튀검증업체 说:
Feb 18, 2024 09:41:18 PM

Design Strategies for Tiny Females Covers together with nice knitted feel, laces, tiny flower prints as well as plaids ought to be provided choice.

먹튀검증 说:
Feb 18, 2024 10:06:59 PM

Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future...Thanks for taking the time to discuss this, I feel strongly that love and read more on this topic.

엔트리파워볼 说:
Feb 18, 2024 10:07:20 PM

You possibly will not get glimmering results with an individual cleaning spiral. Thus, repeat a window cleaning up for several times unless you want to get the specified outcome. And also, you can pass the worry of cleaning up services to your professionals. Utilize window cleaning up services out of DIALAMAID to get effortless cleaning up and unsoiled windows.

안전놀이터 说:
Feb 18, 2024 10:07:42 PM

The first phase the preparation should, theoretically, be uninfluenced by the intended intensity and duration of the sound which is subsequently produced. In fact, however, so quickly are the three phases accomplished that the pianist rarely has capacity to think, in performance, of each phase separately. Roof Cleaning in Bournemouth

안전놀이터 说:
Feb 18, 2024 10:52:13 PM

The when I just read a blog, I hope so it doesnt disappoint me as much as that one. I am talking about, It was my method to read, but I actually thought youd have something fascinating to express. All I hear is often a bunch of whining about something that you could fix in the event you werent too busy looking for attention.

안전놀이터 说:
Feb 18, 2024 10:52:29 PM

Standard sessions allow me to share the simplest way to thanks a lot for ones hard work, which in turn means that I am just traveling to the web page every day, seeking brand-new, exciting information. A lot of, bless you!

토토사이트추천 说:
Feb 18, 2024 10:52:51 PM

The when I just read a blog, I hope so it doesnt disappoint me as much as that one. I am talking about, It was my method to read, but I actually thought youd have something fascinating to express. All I hear is often a bunch of whining about something that you could fix in the event you werent too busy looking for attention.

탐험대 说:
Feb 18, 2024 11:04:30 PM

Gaming pc’s aren’t as difficult as you may perhaps think, and creating your very own gaming pc is not as tricky as a whole lot of folks would make you consider. Because you by now have a distinct software in head when constructing your individual gaming machine, there are actually only three main elements you have to have to worry about, and every little thing else is truly secondary: the processor, video clip card, and RAM.

먹튀검증 说:
Feb 18, 2024 11:04:47 PM

It's a superior strategies notably to help you the a newcomer to blogosphere, summary and even legitimate information… Bless you designed for writing this town. Required browse guide.

온라인카지노쿠폰 说:
Feb 18, 2024 11:41:20 PM

A person necessarily lend a hand to make severely posts I’d state. This is the very first time I frequented your web page and to this point? I surprised with the analysis you made to make this particular submit extraordinary. Magnificent process!

안전놀이터 说:
Feb 18, 2024 11:41:37 PM

Wonderful blog! I found it while surfing around on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Appreciate it.

카지노사이트 说:
Feb 19, 2024 12:08:27 AM

Now i am really fresh to wordpress blogs. however what you post on this site is absolutely very good and very beneficial. I believe it would help me in the future. Thanks for the excellent work.

토토사이트 说:
Feb 19, 2024 12:08:43 AM

Thank you for the sensible critique. Me and my neighbor were just preparing to do some research about this. We got a grab a book from our local library but I think I learned more from this post. I’m very glad to see such wonderful info being shared freely out there.

วิธีใช้งานคาสิโนออนไ 说:
Feb 19, 2024 12:09:09 AM

A well written article, I just passed this onto a workfellow who was doing somewhat analysis on this. And he indeed purchased me dinner because I discovered it for him…. .. therefore let me reword that: Thnkx for the treat however yeah Thnkx for spending the time to talk about this, I feel strongly concerning it and love reading more on this topic. If doable, as you gain expertise, would you mind updating your blog with more details? it is extraordinarily useful on behalf of me. massive thumb up for this blog

먹튀사이트 说:
Feb 19, 2024 12:38:06 AM

This design is spectacular! You obviously know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job. I really enjoyed what you had to say, and more than that, how you presented it. Too cool!

먹튀신고 说:
Feb 19, 2024 12:38:29 AM

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good workYes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more.

먹튀검증사이트 说:
Feb 19, 2024 01:40:47 AM

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good workYes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more.

토토사이트홍보 说:
Feb 19, 2024 01:41:13 AM

This design is spectacular! You obviously know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job. I really enjoyed what you had to say, and more than that, how you presented it. Too cool!

토토사이트추천 说:
Feb 19, 2024 01:41:35 AM

Hello, this weekend is good for me, since this time i am reading this enormous informative article here at my home.I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us.This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future...

메이저사이트꽁머니 说:
Feb 19, 2024 01:52:25 AM

Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future...Thanks for taking the time to discuss this, I feel strongly that love and read more on this topic.

seo service UK 说:
Feb 23, 2024 08:35:33 PM

This is really likewise an incredibly beneficial placing most of us severely encountered shopping as a result of. It truly is faraway from each and every day we have now possibility to think about something


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter