Софтуерно Инженерство
Loading...
+ Нов въпрос
jvelev75 avatar jvelev75 2 Точки

Programming Basic C++ - solution in Judge question

   Здравейте,

в Judge системата първоначално нямаше отделен раздел за задачите от този курс, затова решенията проверях в раздела

Home/Contests/Programming-Basics-Exercises/Simple Calculations.Днес забелязах че вече има отделен раздел специално за C++ и реших да поставя решенията и  в него. За изненада при един и същ код работещ първоначално (Solution #6948288)

сега ми дава грешен отговор (Solution #6975187).Някой да има същият проблем??

   Благодаря предварително!

.

Тагове:
kolioi avatar kolioi 612 Точки
Дай да видим твоя код и да намерим грешката.
0
jvelev75 avatar jvelev75 2 Точки

Здравей,

решение 6948288 от Home/ Contests / Programming-Basics-Exercises / Simple Calculations - отчетено като вярно 100/100

 

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
	double r;
	double pi = 3.14159265359;
	cin >> r;
	double area = pi * r*r;
	double perimeter = 2 * pi*r;
	
	cout << fixed << setprecision(4) << area << endl;
	cout << fixed << setprecision(4) << perimeter << endl;
	
    return 0;

Същият код ( решение  6975019 ) но постнат в  Home/Contests/Programming-Basics-CPlusPlus/Simple Calculations отчетен 25/100.

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
	double r;
	double pi = 3.14159265359;
	cin >> r;
	double area = pi * r*r;
	double perimeter = 2 * pi*r;
	
	cout << fixed << setprecision(4) << area << endl;
	cout << fixed << setprecision(4) << perimeter << endl;
	
    return 0;
}

 И в двата случая е указано че кода е за C++

Благодаря

1
kolioi avatar kolioi 612 Точки

Кода ти е напълно верен. Изглежда има някакъв проблем с Джадж, защото на мен ми дава само 20/100 със същия код - минава само първия тест.

 

П.П. Стойността на π е дефинирана в хедър файла math.h

#define M_PI       3.14159265358979323846   // pi

#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>

using namespace std;

int main()
{
	double r;
	cin >> r;
  
	double area = M_PI * r * r;
	double perimeter = 2 * M_PI * r;

	cout << fixed;
  	cout.precision(4);
  	cout << area << endl << perimeter << endl;

	return 0;
}

https://msdn.microsoft.com/en-us/library/4hwaceh6.aspx

1
20/03/2018 16:16:06
jvelev75 avatar jvelev75 2 Точки

Здравей,

макар и малко късно - благодаря за помощта

0
shethal avatar shethal 2 Точки

Basics of C++

In this section we will cover the basics of C++, it will include the syntax, variable, operators, loop types, pointers, references and information about other requirements of a C++ program. You will come across lot of terms that you have already studied in C language.

Syntax and Structure of C++ program

Here we will discuss one simple and basic C++ program to print "Hello this is C++" and its structure in parts with details and uses.

First C++ program

#include <iostream.h>
using namespace std;
int main()
{
cout << "Hello this is C++";
}

https://www.besanttechnologies.com/training-courses/python-training-institute-in-chennai

 

1
tocnaza avatar tocnaza 2 Точки

more links info:

https://www.reverbnation.com/zoraya
http://prince.org/profile/zoraya
https://www.choralnet.org/members/tocnaza/
https://oss.deltares.nl/web/delft3d/home/-/message_boards/message/1977515/maximized
https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-sites/f/291/t/20332
https://www.studentfilmmakers.com/members/tocnaza/profile/
http://www.niooz.fr/users/tocnaza/Quique
https://www.eeweb.com/profile/sara-zambola
https://www.corejoomla.com/profile/tocnaza.html
https://forum.tp-link.com/member.php?122676-zoraya
https://huzzaz.com/collection/relatos-xxx
https://www.curriki.org/oer/Bego-madrastra-ejemplar/
https://community.progress.com/community_groups/products_enhancements/i/business_rules_management_system_corticon/clases_privadas
https://www.fimfiction.net/user/334838/tocnaza/about
https://developer.gracenote.com/resovled-new-client-id-registration-issue
https://blogs.allnokia.ru/u/1130093/3476/
https://cults3d.com/es/usuarios/tocnaza
http://forum.moex.com/viewtopic.asp?t=35943
http://www.supportduweb.com/profile-43919.html
https://www.steinberg.net/forums/memberlist.php?mode=viewprofile&u=54472
https://phidgets.com/phorum/memberlist.php?mode=viewprofile&u=21709
https://themeegg.com/support-forum/users/tocnaza/
https://precisethemes.com/support-forum/users/tocnaza/
https://up-campus.org/membres/818313
https://www.thinglink.com/user/937014724434853891
https://www.caminosantiago.com/foro/viewtopic.php?f=10&t=25351
https://www.cosis.net/members/profile.php?user=u05a0b3501218076bcb66ff
https://community.progress.com/community_groups/products_enhancements/i/business_rules_management_system_corticon/nuri_y_mis_amigos
http://www.mappery.com/user.php?name=tocnaza
https://solutions-summit.org/users/juancax
https://www.provenexpert.com/juanca-lina/
https://foro.skylium.com/tema-Convertir-Docx-a-Pdf-online
https://yoreparo.com/computadoras/preguntas/1115302/despues-de-un-rato-de-escuchar-music-no-da-audio-el-portatil

0
saralee123 avatar saralee123 1 Точки

TokyoTechie.Com is a leading digital marketing company which provides SEO services in Pune so you can get a high ranking on Google and helps you with our unique Seo Services.  It is quality, Result Oriented, and complete digital marketing agency in Pune.

0