![]() |
|
|
Регистрация Восстановить пароль |
Регистрация | Задать вопрос |
Заплачу за решение |
Новые сообщения |
Сообщения за день |
Расширенный поиск |
Правила |
Всё прочитано |
![]() |
Нет наработок или кода, если нужно готовое решение - создайте тему в разделе Фриланс и оплатите работу. Название темы включает слова - "Помогите", "Нужна помощь", "Срочно", "Пожалуйста". Название темы слишком короткое или не отражает сути вашего вопроса. Тема исчерпала себя, помните, один вопрос - одна тема Прочитайте правила и заново правильно создайте тему. |
|
Опции темы | Поиск в этой теме |
![]() |
#1 |
Новичок
Джуниор
Регистрация: 22.09.2013
Сообщений: 5
|
![]()
есть программа
#include <stdio.h> #include <math.h> #include <conio.h> #include <locale.h> int main() { setlocale(LC_ALL, "Russian"); float x, a, b, c, i, y; printf("Введите значение x = "); scanf("%f", &x); printf("Введите значение a = "); scanf("%f", &a); printf("Введите значение b = "); scanf("%f", &b); printf("Введите значение c = "); scanf("%f", &c); printf("Введите значение i = "); scanf("%f", &i); if ((b == 3) && (x > 1.2) && (c == 1.3)) { if (a == 2) { y = (b*x + a*x*x) / (exp(x) + a*x); } else if (a < 2) { y = pow(a*x, 1.5) + pow(b*x, 1.5) + c; } else if (a > 2) { y = a*pow(x, 3) + c*x; } } else { if (((x >= 0) && (x < 1)) && (a == 0.4)) { y = cos(x) / sqrt(1 + a*a + sin(x)*sin(x)); } else if ((i < 10) && (a == 2.1) && (b == 0.3) && (x > 7) && (x < 12)) { y = a*pow(i, 4) + b*i; } } printf("При x = %1.1f, a = %1.1f, b = %1.1f, c = %1.1f, i = %1.1f y = %1.1f\n", x, a, b, c, i, y); getch(); return 0; } выдает ошибки 1>------ Перестроение всех файлов начато: проект: 6, Конфигурация: Debug Win32 ------ 1>Удаление промежуточных и выходных файлов проекта "6", конфигурации "Debug|Win32" 1>Компиляция... 1>stdafx.cpp 1>Компиляция... 1>AssemblyInfo.cpp 1>6.cpp 1>.\6.cpp(15) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(306): см. объявление 'scanf' 1>.\6.cpp(18) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(306): см. объявление 'scanf' 1>.\6.cpp(21) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(306): см. объявление 'scanf' 1>.\6.cpp(24) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(306): см. объявление 'scanf' 1>.\6.cpp(27) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(306): см. объявление 'scanf' 1>.\6.cpp(33) : error C2666: pow: для 6 перегрузок есть подобные преобразования 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(575): может быть 'long double pow(long double,int)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(573): или 'long double pow(long double,long double)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(527): или 'float pow(float,int)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(525): или 'float pow(float,float)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(489): или 'double pow(double,int)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(123): или 'double pow(double,double)' 1> при попытке сопоставить список аргументов '(float, double)' 1>.\6.cpp(33) : error C2666: pow: для 6 перегрузок есть подобные преобразования 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(575): может быть 'long double pow(long double,int)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(573): или 'long double pow(long double,long double)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(527): или 'float pow(float,int)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(525): или 'float pow(float,float)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(489): или 'double pow(double,int)' 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\math.h(123): или 'double pow(double,double)' 1> при попытке сопоставить список аргументов '(float, double)' 1>Создание кода... 1>Журнал построения был сохранен в "file://c:\Users\Светлана\Documents\Visual Studio 2008\Projects\6\6\Debug\BuildLog.ht m" 1>6 - ошибок 2, предупреждений 5 ========== Перестроение всех: успешно: 0, с ошибками: 1, пропущено: 0 ========== помогите пожалуйста |
![]() |
![]() |
#2 |
C/C++, Java
Участник клуба
Регистрация: 28.03.2012
Сообщений: 1,680
|
![]()
Я так понимаю у вас VS++??? ТАК?
У вас обычное консольное приложение... Создавайте проект Консольное приложение Win32. Вы вероятнее всего создали Проект Win32 Затем, когда добавляете элемент в проект пишите имя создаваемого файла + расширение 'c'. К тому же лучше использовать тип с плавающей точкой двойной точности double Код:
![]()
"Keep it simple" - придерживайтесь простоты!
Уильям Оккам - "Не следует множить сущее без необходимости" Сложность - враг простоты и удобства! Последний раз редактировалось Bugrimov; 22.09.2013 в 21:05. |
![]() |
![]() |
#3 | |
Новичок
Джуниор
Регистрация: 22.09.2013
Сообщений: 5
|
![]() Цитата:
1>Компиляция... 1>12.cpp 1>c:\users\светлана\documents\visua l studio 2008\projects\12\12\12.cpp(16) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(306): см. объявление 'scanf' 1>c:\users\светлана\documents\visua l studio 2008\projects\12\12\12.cpp(19) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(306): см. объявление 'scanf' 1>c:\users\светлана\documents\visua l studio 2008\projects\12\12\12.cpp(22) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(306): см. объявление 'scanf' 1>c:\users\светлана\documents\visua l studio 2008\projects\12\12\12.cpp(25) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(306): см. объявление 'scanf' 1>c:\users\светлана\documents\visua l studio 2008\projects\12\12\12.cpp(28) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(306): см. объявление 'scanf' 1>c:\users\светлана\documents\visua l studio 2008\projects\12\12\12.cpp(34) : error C2666: pow: для 6 перегрузок есть подобные преобразования 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(575): может быть 'long double pow(long double,int)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(573): или 'long double pow(long double,long double)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(527): или 'float pow(float,int)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(525): или 'float pow(float,float)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(489): или 'double pow(double,int)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(123): или 'double pow(double,double)' 1> при попытке сопоставить список аргументов '(float, double)' 1>c:\users\светлана\documents\visua l studio 2008\projects\12\12\12.cpp(34) : error C2666: pow: для 6 перегрузок есть подобные преобразования 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(575): может быть 'long double pow(long double,int)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(573): или 'long double pow(long double,long double)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(527): или 'float pow(float,int)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(525): или 'float pow(float,float)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(489): или 'double pow(double,int)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(123): или 'double pow(double,double)' 1> при попытке сопоставить список аргументов '(float, double)' 1>Журнал построения был сохранен в "file://c:\Users\Светлана\Documents\Visual Studio 2008\Projects\12\12\Debug\BuildLog. htm" 1>12 - ошибок 2, предупреждений 5 ========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ========== |
|
![]() |
![]() |
#4 |
C/C++, Java
Участник клуба
Регистрация: 28.03.2012
Сообщений: 1,680
|
![]()
У вас файл с расширением cpp. Среда когда видит это расширение использует компилятор для C++, а вам нужно для Си
Чтобы избавиться от предупреждений (некоторых) в самом самом верху над #include пишите Код:
"Keep it simple" - придерживайтесь простоты!
Уильям Оккам - "Не следует множить сущее без необходимости" Сложность - враг простоты и удобства! Последний раз редактировалось Bugrimov; 22.09.2013 в 21:15. |
![]() |
![]() |
#5 | |
Новичок
Джуниор
Регистрация: 22.09.2013
Сообщений: 5
|
![]() Цитата:
|
|
![]() |
![]() |
![]() |
||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
Помогите создать програму для роботы с файлами, пожалуйста помогите нужно очень срочно | Сергей Человек | Фриланс | 3 | 06.07.2009 19:30 |
Помогите Помогите Пожалуйста Решить Одну Задачку в Паскале!!! | VisTBacK | Помощь студентам | 6 | 19.09.2008 13:44 |