用c语言写播放音乐的程序,为何出现#ignoring pragma comment,如何解决?

各位大佬,我用的软件是codeblocks,电脑是惠普的暗夜精灵4,以下是我编写播放音乐的c语言的代码

#include< stdio.h>
#include < stdlib.h>
#include< windows.h>
#include< mmsystem.h>
#pragma comment(lib,"winmm.lib")
int main()
{
while(1)
{

PlaySound(TEXT("\sounds"),
NULL, SND_FILENAME | SND_ASYNC | SND_LOOP );
return 0;
}
}

也在编译器的链接器设置中写了-lwinmm,也在该程序的文件夹的bin-debug中放置文件夹songs,里面都是wav式的音乐,但编译时始终出现ignoring #pragma comment的字样,
那位大神路过能帮忙解决一下,不胜感激。
通过测试,其实是使用的vc有问题,使用vs2017完全没有问题

1个回答

pragma comment 是特定编译器才能识别的,你的代码没有贴对,具体开头是什么我看不到,但是既然提示,那么就是cb用的gcc不能识别,你用vc++编译看看

caozhy
贵阳老马马善福专业维修游泳池堵漏防水工程 回复qq_43784742: 你当然要会修改。
一年多之前 回复
qq_43784742
等一盏茶凉 绝望,我尝试用vc的include 和lib文件放入第三方库,但是却显示一堆错误
一年多之前 回复
qq_43784742
等一盏茶凉 大神能不能帮忙找一下头文件和库文件,我是在找不到啊
一年多之前 回复
qq_43784742
等一盏茶凉 回复caozhy: 第三方库是要自己找吗
一年多之前 回复
caozhy
贵阳老马马善福专业维修游泳池堵漏防水工程 回复qq_43784742: windows platform sdk里有,或者从vc++里找,但是你最好还是直接用vc++
一年多之前 回复
qq_43784742
等一盏茶凉 头文件和库怎么得到
一年多之前 回复
caozhy
贵阳老马马善福专业维修游泳池堵漏防水工程 回复qq_43784742: https://blog.csdn.net/rznice/article/details/18085271
一年多之前 回复
qq_43784742
等一盏茶凉 怎么指定,求指教
一年多之前 回复
caozhy
贵阳老马马善福专业维修游泳池堵漏防水工程 回复qq_43784742: 应该就是这个问题,gcc不能认识这个pragma comment,你非要gcc,需要在编译配置里指定lib
一年多之前 回复
qq_43784742
等一盏茶凉 我的编译器是GNU GCC complier
一年多之前 回复
qq_43784742
等一盏茶凉 现在开头有了,能再详细说一下问题吗
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
#pragma comment(lib,"winmm.lib")出现warning

#include <stdio.h> #include <stdlib.h> #include <windows.h> #include <mmsystem.h> #pragma comment(lib,"winmm.lib") #include <unistd.h> int main() { printf("hello,word!"); PlaySound(TEXT("sounds\\HOT"),NULL,SND_FILENAME | SND_ASYNC | SND_LOOP); printf("hello,word!"); Sleep(5000); return 0; } 出现了warning ||=== 构建: Debug 在 emperor 中 (编译器: GNU GCC Compiler) ===| D:\codeblocks\emperor\main.c|5|warning: ignoring #pragma comment [-Wunknown-pragmas]| ||=== 构建 finished: 0 error(s), 1 warning(s) (0 分, 1 秒) ===|

PTA 出现 warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]怎么解决

最近总是碰到这种错误,而且我的输出格式是直接复制过来的,所以输出格式没有错。 PTA L1-005 考试座位号 出现 warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]怎么解决查了好多,原因都不太一样 每个 PAT 考生在参加考试时都会被分配两个座位号,一个是试机座位,一个是考试座位。正常情况下,考生在入场时先得到试机座位号码,入座进入试机状态后,系统会显示该考生的考试座位号码,考试时考生需要换到考试座位就座。但有些考生迟到了,试机已经结束,他们只能拿着领到的试机座位号码求助于你,从后台查出他们的考试座位号码。 输入格式: 输入第一行给出一个正整数 N(≤1000),随后 N 行,每行给出一个考生的信息:准考证号 试机座位号 考试座位号。其中准考证号由 16 位数字组成,座位从 1 到 N 编号。输入保证每个人的准考证号都不同,并且任何时候都不会把两个人分配到同一个座位上。 考生信息之后,给出一个正整数 M(≤N),随后一行中给出 M 个待查询的试机座位号码,以空格分隔。 输出格式: 对应每个需要查询的试机座位号码,在一行中输出对应考生的准考证号和考试座位号码,中间用 1 个空格分隔。 输入样例: 4 3310120150912233 2 4 3310120150912119 4 1 3310120150912126 1 3 3310120150912002 3 2 2 3 4 输出样例: 3310120150912002 2 3310120150912119 1 ``` #include<stdio.h> int main() { int n, i; scanf("%d", &n); long long int num[1001] = { 0 }; int t[1001] = { 0 }; int k[1001] = { 0 }; for (i = 0; i<n; i++) { scanf("%lld %d %d", &num[i], &t[i], &k[i]); } int checknum; int check[1001] = { 0 }; scanf("%d", &checknum); int j = 0; for (j = 0; j<checknum; j++) { scanf("%d", &check[j]); } int m = 0; for (i = 0; i < n; i++) { if ((check[m] == t[i]) & (m<=j)) { printf("%lld %d\n", num[i], k[i]); m++; i = 0; } } return 0; } ``` 1. vs运行的结果 ![图片说明](https://img-ask.csdn.net/upload/202002/20/1582197445_948664.jpg) 2.PTA运行的结果 ![图片说明](https://img-ask.csdn.net/upload/202002/20/1582198026_265208.jpg) ![图片说明](https://img-ask.csdn.net/upload/202002/20/1582197857_895721.jpg) 浙大版《C语言程序设计(第3版)》题目集 习题2-2 阶梯电价 (15分) 为了提倡居民节约用电,某省电力公司执行“阶梯电价”,安装一户一表的居民用户电价分为两个“阶梯”:月用电量50千瓦时(含50千瓦时)以内的,电价为0.53元/千瓦时;超过50千瓦时的,超出部分的用电量,电价上调0.05元/千瓦时。请编写程序计算电费。 输入格式: 输入在一行中给出某用户的月用电量(单位:千瓦时)。 输出格式: 在一行中输出该用户应支付的电费(元),结果保留两位小数,格式如:“cost = 应付电费值”;若用电量小于0,则输出"Invalid Value!"。 输入样例1: 10 输出样例1: cost = 5.30 输入样例2: 100 输出样例2: cost = 55.50 ``` #include<stdio.h> int main() { double x; double cost; scanf("%lf",&x); if(x<0) printf("Invalid Value!"); else if(x>50) cost=26.5+(x-50)*0.58; else cost=0.53*x; printf("cost = %0.2f\n",cost); return 0; } ``` ![图片说明](https://img-ask.csdn.net/upload/202002/21/1582277094_488042.jpg) 这两个代码的vs运行都是对的。求问问题出在哪里了,xx~

U盘安装CENTOS7双系统时出现ignoring BGRT报错,无法进入图形界面安装程序

我就是用ultraISO做的启动盘,然后进入bios,设置U盘启动,然后开始进入安装界面,改了磁盘路径,但然后就报错ignoring BGRT,无法进入图形界面继续安装

Error:warning: Ignoring InnerClasses

Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug] Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.diffdev.a.b) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.diffdev.a.c) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.openapi.WXApiImplV10$1) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.openapi.WXApiImplV10$ActivityLifecycleCb$1) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(com.tencent.mm.opensdk.openapi.WXApiImplV10$ActivityLifecycleCb$2) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class. Information:BUILD SUCCESSFUL Information:Total time: 36.571 secs Information:40 errors Information:0 warnings Information:See complete output in console 大神们看下这个怎么解决, multiDexEnabled true,这个我已经加上了,application也加上了,上面的错误有一个com.tencent.mm.opensdk.diffdev.a.b提示,我是之前做微信第三方登陆加了他们的库,不知道是不是这个原因

请问为什么这题会报错

ignoring return value of 'scanf', declared with attribute warn_unus #include<stdio.h> int main() { int n; while(scanf("%d",&n)!=EOF) { int a[n][n]; int i,j; for(i=0;i<n;i++) { for(j=0;j<n;j++) { scanf("%d",&a[i][j]); } } for(i=0;i<n;i++) { for(j=0;j<n;j++) { printf("%d",a[j][i]); if(j<n-1) printf(" "); } printf("\n"); } } return 0; } 输入 两个整数n和m,表示泥潭的长和宽。下面n行m列表示地形(0 表示泥潭,1 表示落脚点) 输出: 用坐标表示穿越路线,坐标之间用>分隔

在三国杀游戏中的一个策略计算,怎么才能使用C语言的程序的编写的技术的方法来实现这个程序的编写的

Problem Description "Killers of Three Kingdoms" is a popular role playing card game designed with the novel Romance of the Three Kingdoms. The game has four kinds of "Equipment Card": "Armour", "Weapon", "+1 horse", "-1 horse". Each player has an equipped-item area to hold equipments. A player is allowed to own only one of each of these 4 equipments in the equipped-item area. Equipments can be replaced by one of the same kind. However, after the replacement, the previous ones would be discarded. For simplicity, cards not belong to equipment (tool cards, basic cards and so on) are united as "Other Card" ignoring their functions in this problem. Sun Shangxiang(Nickname: Xiangxiang), the lady with bow and arrows, is one of the favorable characters in this game. Her 2nd character ability - "Warrior Lady" (枭姬xiāo jī in Chinese) is described below: Whenever an equipped card is discarded from the equipped-item area, Xiangxiang can immediately draw 2 cards from the deck. Note that Xiangxiang cannot voluntarily remove her equipped items. She can only replace them. Now it is Xiangxiang’s turn. She has a certain amount of cards of each kind in her hand and her equipped-item area is empty. Given the number of cards of each kind in the deck, assume that every card in the deck will be taken with equal probability, and Xiangxiang will always equip the "Equipment Card" once she gets it. What is the expected number of cards Xiangxiang can draw in her action phase? Input In the first line there is an integer T, indicates the number of test cases. (T <= 100) For each case, two lines are given. The first line describes Xiangxiang’s hand cards, 5 integers indicating the number of "Armour", "Weapon", "+1 horse", "-1 horse" and "Other Card" respectively. The second line describes the cards in the deck which has the same format as above. The sum of the 10 integers is no more than 104. Output For each case, output "Case k: v" on a single line, in which k is the case number, v is the maximum expected number of cards Xiangxiang can draw round to 2 digits after decimal point. Sample Input 3 2 0 0 0 0 0 0 0 0 1 0 0 0 5 0 0 0 0 0 9 0 0 0 2 0 0 0 0 1 2 Sample Output Case 1: 1.00 Case 2: 8.00 Case 3: 2.67

猜数字判断对错的问题统计错误的数量,要求使用C语言的程序代码的编写的技术实现,怎么做的

Problem Description TT and FF are ... friends. Uh... very very good friends -________-b FF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT should write down a sequence of integers-_-!!(bored). Then, FF can choose a continuous subsequence from it(for example the subsequence from the third to the fifth integer inclusively). After that, FF will ask TT what the sum of the subsequence he chose is. The next, TT will answer FF's question. Then, FF can redo this process. In the end, FF must work out the entire sequence of integers. Boring~~Boring~~a very very boring game!!! TT doesn't want to play with FF at all. To punish FF, she often tells FF the wrong answers on purpose. The bad boy is not a fool man. FF detects some answers are incompatible. Of course, these contradictions make it difficult to calculate the sequence. However, TT is a nice and lovely girl. She doesn't have the heart to be hard on FF. To save time, she guarantees that the answers are all right if there is no logical mistakes indeed. What's more, if FF finds an answer to be wrong, he will ignore it when judging next answers. But there will be so many questions that poor FF can't make sure whether the current answer is right or wrong in a moment. So he decides to write a program to help him with this matter. The program will receive a series of questions from FF together with the answers FF has received from TT. The aim of this program is to find how many answers are wrong. Only by ignoring the wrong answers can FF work out the entire sequence of integers. Poor FF has no time to do this job. And now he is asking for your help~(Why asking trouble for himself~~Bad boy) Input Line 1: Two integers, N and M (1 <= N <= 200000, 1 <= M <= 40000). Means TT wrote N integers and FF asked her M questions. Line 2..M+1: Line i+1 contains three integer: Ai, Bi and Si. Means TT answered FF that the sum from Ai to Bi is Si. It's guaranteed that 0 < Ai <= Bi <= N. You can assume that any sum of subsequence is fit in 32-bit integer. Output A single line with a integer denotes how many answers are wrong. Sample Input 10 5 1 10 100 7 10 28 1 3 32 4 6 41 6 6 1 Sample Output 1

CGO如何抑制警告

<div class="post-text" itemprop="text"> <p>I have a cgo application that uses a C library. During the build process, the compiler shows some warnigns:</p> <pre><code>In file included from ./libsolv-sys/src/qsort_r.c:40:0, from ./libsolv-sys/src/util.c:181, from ./libsolv.go:16: /usr/include/sys/cdefs.h:1:2: warning: #warning usage of non-standard #include &lt;sys/cdefs.h&gt; is deprecated [-Wcpp] #warning usage of non-standard #include &lt;sys/cdefs.h&gt; is deprecated ^~~~~~~ </code></pre> <p>This library is not maintained by myself and I am not able to fix this warning directly. I am sick of the warning though.</p> <p><strong>Question:</strong> How do I suppress warnings in CGO?</p> <p><strong>Used CGO Flags:</strong> <code>CFLAGS: -I./libsolv-sys/src -D LIBSOLV_INTERNAL</code> <code>LDFLAGS: ${SRCDIR}/libsolv-sys.a</code></p> </div>

字符串比较规则的一个实现的问题,要求使用C语言的程序的代码的描述的过程是什么

Problem Description The downtown core of Inner City is laid out as a grid, with numbered streets running north-south from 1st Street in the west to 20th Street in the east, and numbered avenues running east-west from 1st Avenue in the north to 20th Avenue in the south. The area is controlled by two gangs, the Blips and the Cruds. The boundary between their territory is the Green Line, running diagonally from the intersection of 1st Street and 1st Avenue to the intersection of 20th Street and 20th Avenue. The Blips control the area to the southwest of the Green Line, and the Cruds the area to the northeast. To prove their virility, the Blips go on "runs" through Crud territory, starting at 1st Avenue and 1st Street and ending at a point on the Green Line that varies from night to night. A run may return to the Green Line in between but never crosses it. A run uses avenues only in the east direction and streets only in the south direction. Thus a run can be described by a string of E's and S's of length 2N-2; such a run ends at Nth Street and Nth Avenue. The Blips judge the runs made on a given night (all of which have the same length) by how "OG" they are. A run R1 is more OG than a run R2 if and only if: 1) R2 returns to the Green Line for the first time at an earlier point than when R1 returns to the Green Line, or 2) R1 and R2 return to the Green Line at the same point, but the portion of R1 to that point (ignoring the initial E and final S) is more OG than the portion of R2 to that point (also ignoring the initial E and final S), or 3) R1 and R2 return to the Green Line at the same point and are identical to that point, but the rest of R1 is more OG than the rest of R2. Examples corresponding to these three cases: 1) EESS is more OG than ESES. 2) EEESSS is more OG than EESESS 3) EESSEESS is more OG than EESSESES. If all the runs of a given length are ordered according to how OG they are, then the rank of a run is its position in the resulting list. EESS has rank 1 and ESES has rank 2. Your task is to write a program to help the Blips plan and judge their nightly activities. Input The input to the program is a series of instances followed by 0 0. An instance consists of a line containing a positive integer N, representing the terminus of that night's run (Nth Street and Nth Avenue), followed by positive integer M. Output The output corresponding to each instance is the run of length 2N-2 of rank M, or ERROR if there are fewer than M runs of length 2N-2. Sample Input 3 1 3 2 3 3 0 0 Sample Output EESS ESES ERROR

打开Eclipse 出现Warning

我从网站上下了几个安卓源代码准备自己分析,先开始是说缺少匹配的环境19 我就又下载了个19放在了paltforms中 ,虽然程序不报错了 也可以布置载虚拟机上了,但是 每次一进Eclipse就提示Warning: Ignoring platform 'android-19': build.prop is missing. 不知道是什么原因

C语言中 i_tmp -= (i_tmp >> 4 << 4)什么意思

float f_value = 15.02; int i_tmp; time_t t; srand((unsigned)time(&t)); //初始化随机种子, 否则随机数不随机 i_tmp = rand(); i_tmp -= (i_tmp >> 4 << 4); f_value += i_tmp;

求 Ignoring InnerClasses att

![图片说明](https://img-ask.csdn.net/upload/201609/07/1473231968_187352.png) 求教大神,我用Android studio 2.2 Beta3运行项目的时候出现了这样子的警告,请问这是什么情况?项目能够正常运行,但是没有效果实现。

PTA7-6 厘米换算英尺英寸 我的代码问题...

如果已知英制长度的英尺foot和英寸inch的值,那么对应的米是(foot+inch/12)×0.3048。现在,如果用户输入的是厘米数,那么对应英制长度的英尺和英寸是多少呢?别忘了1英尺等于12英寸。 输入格式: 输入在一行中给出1个正整数,单位是厘米。 输出格式: 在一行中输出这个厘米数对应英制长度的英尺和英寸的整数值,中间用空格分开。 输入样例: 170 输出样例: 5 6 **我的代码** ``` #include<stdio.h> int main() { int cm=0; scanf("%d",&cm); int foot=cm/100/0.3048; int inch=(cm/100.0/0.3048-foot)*12; printf("%d %d\n",foot,inch); return 0; } ``` ``` a.c: In function ‘main’: a.c:5:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&cm); ^~~~~~~~~~~~~~~ ``` **基础不扎实,求大佬们指教谢谢!**

关于trunk的install的index missing问题如何解决?

在使用./scripts/feeds install –a时会出现如下问题: Ignoring feed 'packages' - index missing Ignoring feed 'luci' - index missing Ignoring feed 'routing' - index missing Ignoring feed 'telephony' - index missing Ignoring feed 'management' - index missing 发现openWRT的trunk下的feeds里只有关于packages的文件,而没有其它例如luci等文件和索引, 请问如何解决问题

Ingeoding Array ...同时IGNORING嵌套数组?

<div class="post-text" itemprop="text"> <p>I have looked around and I see a lot of people asking how to implode arrays with nested arrays. However, these people usually want to include the nested array as well. I do not want to include the nested array... I want to throw out the nested array...</p> <p>This is my array:</p> <pre><code>[tag] =&gt; Array ( [0] =&gt; one [1] =&gt; two [0_attr] =&gt; Array ( [category] =&gt; three [lock] =&gt; four ) [2] =&gt; five ) </code></pre> <p>If I implode this array, comma delimited, I want the result to be:</p> <pre><code>one, two, five </code></pre> <p>Notice how three and four are NOT included. Since they are a nested array, I don't want it. I only want immediate values. How exactly would I get this done?</p> </div>

最短路径搜索,除了暴搜以外,采用C语言的还有更优化的办法怎么做呢?

Problem Description The discovery of anti-gravitations technology changed the world. The invention of anti-gravitation shoes (Grav-shoes) enables people to fly in the sky freely. This led to the rise of a new sky sport: ``Flying Circus". Utilizing Grav-shoes and personal flying suits, competitors battle it out in a special field, where they compete scoring obtain m points within a certain time limit. The field is a square with edge length 300 meters. Moreover, there are four buoys floating at each corner of the square. Four buoys are numbered as 1,2,3,4 in clockwise order. Two players start at buoy #1. When game begin, they will try to touch four floating buoys in clockwise order. (Since buoy #1 is the start point, the first buoy they need to touch will be buoy #2, and after that, they need to touch buoy #3,#4,#1 in order) Note that they could fly freely in the field, even fly inside the square field. Under two situations the player could score one point. ⋅1. If you touch a buoy before your opponent, you will get one point. For example if your opponent touch the buoy #2 before you after start, he will score one point. So when you touch the buoy #2, you won't get any point. Meanwhile, you cannot touch buoy #3 or any other buoys before touching the buoy #2. ⋅2. Ignoring the buoys and relying on dogfighting to get point. If you and your opponent meet in the same position, you can try to fight with your opponent to score one point. For the proposal of game balance, two players are not allowed to fight before buoy #2 is touched by anybody. There are three types of players. Speeder: As a player specializing in high speed movement, he/she tries to avoid dogfighting while attempting to gain points by touching buoys. Fighter: As a player specializing in dogfighting, he/she always tries to fight with the opponent to score points. Since a fighter is slower than a speeder, it's difficult for him/her to score points by touching buoys when the opponent is a speeder. All-Rounder: A balanced player between Fighter and Speeder. There will be a training match between Asuka (All-Rounder) and Shion (Speeder). Since the match is only a training match, the rules are simplified: the game will end after the buoy #1 is touched by anybody. Shion is a speed lover, and his strategy is very simple: touch buoy #2,#3,#4,#1 along the shortest path. Asuka is good at dogfighting, so she will always score one point by dogfighting with Shion, and the opponent will be stunned for T seconds after dogfighting. Since Asuka is slower than Shion, she decides to fight with Shion for only one time during the match. It is also assumed that if Asuka and Shion touch the buoy in the same time, the point will be given to Asuka and Asuka could also fight with Shion at the buoy. We assume that in such scenario, the dogfighting must happen after the buoy is touched by Asuka or Shion. The speed of Asuka is V1 m/s. The speed of Shion is V2 m/s. Is there any possibility for Asuka to win the match (to have higher score)? Input The first line contains an integer t (0<t≤1000), followed by t lines. Each line contains three double T, V1 and V2 (0≤V1≤V2≤2000,0≤T≤2000) with no more than two decimal places, stands for one case. Output If there exist any strategy for Asuka to win the match, output ``Yes", otherwise, output ``No". Sample Input 2 1 10 13 100 10 13 Sample Output Case #1: No Case #2: Yes

PTA上的错误分析,求大神指点(#>д<)ノ

求解求解: 最近在PTA上刷题,先从简单的开始吧。。写一道题时在DEV上编译没什么问题,但是在PTA上提交之后说编译有错误,不知道怎么回事。 代码如下: #include <stdio.h> void printfN(int N); int main() { int N; printf("Inpute an positive number:"); scanf("%d",&N); printfN(N); return 0; } void printfN(int N) { if(N<1) printf("Ivalid Input!\n"); else { for(int i=1;i<=N;i++) printf("%d\n",i); } } 错误如是说: a.c:16:5: error: redefinition of 'main' int main() ^ a.c:4:5: note: previous definition of 'main' was here int main () ^ a.c: In function 'main': a.c:8:7: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &N); ^ a.c: In function 'main': a.c:20:7: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&N); ^

我在安装vasp4.6时进行最后一步编译vasp4的makefile时有问题

我make后makefile:344: 警告:覆盖关于目标“xcgrad.o”的命令 makefile:289: 警告:忽略关于目标“xcgrad.o”的旧命令 ifort -Mfree -Mx,119,0x200000 -O2 -tp p6 -c base.f ifort: command line warning #10006: ignoring unknown option '-Mfree' ifort: command line warning #10006: ignoring unknown option '-Mx,119,0x200000' ifort: command line remark #10148: option '-tp p6' not supported base.f(1): error #5149: Illegal character in statement label field [/] /* Copyright (C) 1991-2014 Free Software Foundation, Inc. ^ base.f(1): error #5149: Illegal character in statement label field [*] /* Copyright (C) 1991-2014 Free Software Foundation, Inc. -^ base.f(1): error #5149: Illegal character in statement label field [C] /* Copyright (C) 1991-2014 Free Software Foundation, Inc. ---^ base.f(1): error #5149: Illegal character in statement label field [o] /* Copyright (C) 1991-2014 Free Software Foundation, Inc. ----^ base.f(1): error #5118: First statement in file must not be continued /* Copyright (C) 1991-2014 Free Software Foundation, Inc. -----^ base.f(2): error #5149: Illegal character in statement label field [T] This file is part of the GNU C Library. ---^ base.f(2): error #5149: Illegal character in statement label field [h] This file is part of the GNU C Library. ----^ base.f(4): error #5149: Illegal character in statement label field [T] The GNU C Library is free software; you can redistribute it and/or ---^ base.f(4): error #5149: Illegal character in statement label field [h] The GNU C Library is free software; you can redistribute it and/or ----^ base.f(1): error #5082: Syntax error, found INTEGER_CONSTANT '1991' when expecting one of: ( % [ . = => /* Copyright (C) 1991-2014 Free Software Foundation, Inc. -----------------^ base.f(5): error #5149: Illegal character in statement label field [m] modify it under the terms of the GNU Lesser General Public ---^ base.f(5): error #5149: Illegal character in statement label field [o] modify it under the terms of the GNU Lesser General Public ----^ base.f(6): error #5149: Illegal character in statement label field [L] License as published by the Free Software Foundation; either ---^ base.f(6): error #5149: Illegal character in statement label field [i] License as published by the Free Software Foundation; either ----^ base.f(4): error #5082: Syntax error, found '/' when expecting one of: ( % [ : . = => The GNU C Library is free software; you can redistribute it and/or ------------------------------------------------------------------^ base.f(7): error #5149: Illegal character in statement label field [v] version 2.1 of the License, or (at your option) any later version. ---^ base.f(7): error #5149: Illegal character in statement label field [e] version 2.1 of the License, or (at your option) any later version. ----^ base.f(9): error #5149: Illegal character in statement label field [T] The GNU C Library is distributed in the hope that it will be useful, ---^ base.f(9): error #5149: Illegal character in statement label field [h] The GNU C Library is distributed in the hope that it will be useful, ----^ base.f(10): error #5149: Illegal character in statement label field [b] but WITHOUT ANY WARRANTY; without even the implied warranty of ---^ base.f(10): error #5149: Illegal character in statement label field [u] but WITHOUT ANY WARRANTY; without even the implied warranty of ----^ base.f(7): error #5082: Syntax error, found INTEGER_CONSTANT '1' when expecting one of: <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> version 2.1 of the License, or (at your option) any later version. -------------^ base.f(11): error #5149: Illegal character in statement label field [M] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ---^ base.f(11): error #5149: Illegal character in statement label field [E] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ----^ base.f(12): error #5149: Illegal character in statement label field [L] Lesser General Public License for more details. ---^ base.f(12): error #5149: Illegal character in statement label field [e] Lesser General Public License for more details. ----^ base.f(14): error #5149: Illegal character in statement label field [Y] You should have received a copy of the GNU Lesser General Public ---^ base.f(14): error #5149: Illegal character in statement label field [o] You should have received a copy of the GNU Lesser General Public ----^ base.f(15): error #5149: Illegal character in statement label field [L] License along with the GNU C Library; if not, see ---^ base.f(15): error #5149: Illegal character in statement label field [i] License along with the GNU C Library; if not, see ----^ base.f(16): catastrophic error: Too many errors, exiting compilation aborted for base.f (code 1) make: *** [base.o] 错误 1 求大神相助啊

采用C语言解决这个距离远近的长短的判断的算法怎么实现?具体的思路谢谢

Problem Description The downtown core of Inner City is laid out as a grid, with numbered streets running north-south from 1st Street in the west to 20th Street in the east, and numbered avenues running east-west from 1st Avenue in the north to 20th Avenue in the south. The area is controlled by two gangs, the Blips and the Cruds. The boundary between their territory is the Green Line, running diagonally from the intersection of 1st Street and 1st Avenue to the intersection of 20th Street and 20th Avenue. The Blips control the area to the southwest of the Green Line, and the Cruds the area to the northeast. To prove their virility, the Blips go on "runs" through Crud territory, starting at 1st Avenue and 1st Street and ending at a point on the Green Line that varies from night to night. A run may return to the Green Line in between but never crosses it. A run uses avenues only in the east direction and streets only in the south direction. Thus a run can be described by a string of E's and S's of length 2N-2; such a run ends at Nth Street and Nth Avenue. The Blips judge the runs made on a given night (all of which have the same length) by how "OG" they are. A run R1 is more OG than a run R2 if and only if: 1) R2 returns to the Green Line for the first time at an earlier point than when R1 returns to the Green Line, or 2) R1 and R2 return to the Green Line at the same point, but the portion of R1 to that point (ignoring the initial E and final S) is more OG than the portion of R2 to that point (also ignoring the initial E and final S), or 3) R1 and R2 return to the Green Line at the same point and are identical to that point, but the rest of R1 is more OG than the rest of R2. Examples corresponding to these three cases: 1) EESS is more OG than ESES. 2) EEESSS is more OG than EESESS 3) EESSEESS is more OG than EESSESES. If all the runs of a given length are ordered according to how OG they are, then the rank of a run is its position in the resulting list. EESS has rank 1 and ESES has rank 2. Your task is to write a program to help the Blips plan and judge their nightly activities. Input The input to the program is a series of instances followed by 0 0. An instance consists of a line containing a positive integer N, representing the terminus of that night's run (Nth Street and Nth Avenue), followed by positive integer M. Output The output corresponding to each instance is the run of length 2N-2 of rank M, or ERROR if there are fewer than M runs of length 2N-2. Sample Input 3 1 3 2 3 3 0 0 Sample Output EESS ESES ERROR

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

CSDN:因博主近期注重写专栏文章(已超过150篇),订阅博主专栏人数在突增,近期很有可能提高专栏价格(已订阅的不受影响),提前声明,敬请理解!

CSDN:因博主近期注重写专栏文章(已超过150篇),订阅博主专栏人数在突增,近期很有可能提高专栏价格(已订阅的不受影响),提前声明,敬请理解! 目录 博客声明 大数据了解博主粉丝 博主的粉丝群体画像 粉丝群体性别比例、年龄分布 粉丝群体学历分布、职业分布、行业分布 国内、国外粉丝群体地域分布 博主的近期访问每日增量、粉丝每日增量 博客声明 因近期博主写专栏的文章越来越多,也越来越精细,逐步优化文章。因此,最近一段时间,订阅博主专栏的人数增长也非常快,并且专栏价

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

工作八年,月薪60K,裸辞两个月,投简历投到怀疑人生!

近日,有网友在某职场社交平台吐槽,自己裸辞两个月了,但是找工作却让自己的心态都要崩溃了,全部无果,不是已查看无回音,就是已查看不符合。 “工作八年,两年一跳,裸辞两个月了,之前月薪60K,最近找工作找的心态崩了!所有招聘工具都用了,全部无果,不是已查看无回音,就是已查看不符合。进头条,滴滴之类的大厂很难吗???!!!投简历投的开始怀疑人生了!希望 可以收到大厂offer” 先来看看网...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

MySQL性能优化(五):为什么查询速度这么慢

前期回顾: MySQL性能优化(一):MySQL架构与核心问题 MySQL性能优化(二):选择优化的数据类型 MySQL性能优化(三):深入理解索引的这点事 MySQL性能优化(四):如何高效正确的使用索引 前面章节我们介绍了如何选择优化的数据类型、如何高效的使用索引,这些对于高性能的MySQL来说是必不可少的。但这些还完全不够,还需要合理的设计查询。如果查询写的很糟糕,即使表结构再合理、索引再...

用了这个 IDE 插件,5分钟解决前后端联调!

点击上方蓝色“程序猿DD”,选择“设为星标”回复“资源”获取独家整理的学习资料!作者 |李海庆我是一个 Web 开发前端工程师,受到疫情影响,今天是我在家办公的第78天。开发了两周,...

大厂的 404 页面都长啥样?最后一个笑了...

每天浏览各大网站,难免会碰到404页面啊。你注意过404页面么?猿妹搜罗来了下面这些知名网站的404页面,以供大家欣赏,看看哪个网站更有创意: 正在上传…重新上传取消 腾讯 正在上传…重新上传取消 网易 淘宝 百度 新浪微博 正在上传…重新上传取消 新浪 京东 优酷 腾讯视频 搜...

【高并发】高并发秒杀系统架构解密,不是所有的秒杀都是秒杀!

网上很多的文章和帖子中在介绍秒杀系统时,说是在下单时使用异步削峰来进行一些限流操作,那都是在扯淡! 因为下单操作在整个秒杀系统的流程中属于比较靠后的操作了,限流操作一定要前置处理,在秒杀业务后面的流程中做限流操作是没啥卵用的。

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

Java14 新特性解读

Java14 已于 2020 年 3 月 17 号发布,官方特性解读在这里:https://openjdk.java.net/projects/jdk/14/以下是个人对于特性的中文式...

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

疫情后北上广深租房价格跌了吗? | Alfred数据室

去年3月份我们发布了《北上广深租房图鉴》(点击阅读),细数了北上广深租房的各种因素对租房价格的影响。一年过去了,在面临新冠疫情的后续影响、城市尚未完全恢复正常运转、学校还没开学等情况下...

面试官给我挖坑:a[i][j] 和 a[j][i] 有什么区别?

点击上方“朱小厮的博客”,选择“设为星标”后台回复&#34;1024&#34;领取公众号专属资料本文以一个简单的程序开头——数组赋值:int LEN = 10000; int[][] ...

又一起程序员被抓事件

就在昨天互联网又发生一起让人心酸的程序员犯罪事件,著名的百度不限速下载软件 Pandownload PC 版作者被警方抓获。案件大致是这样的:软件的作者不仅非法盗取用户数据,还在QQ群进...

应聘3万的职位,有必要这么刁难我么。。。沙雕。。。

又一次被面试官带到坑里面了。面试官:springmvc用过么?我:用过啊,经常用呢面试官:springmvc中为什么需要用父子容器?我:嗯。。。没听明白你说的什么。面试官:就是contr...

太狠了,疫情期间面试,一个问题砍了我5000!

疫情期间找工作确实有点难度,想拿到满意的薪资,确实要点实力啊!面试官:Spring中的@Value用过么,介绍一下我:@Value可以标注在字段上面,可以将外部配置文件中的数据,比如可以...

Intellij IDEA 美化指南

经常有人问我,你的 IDEA 配色哪里搞的,我会告诉他我自己改的。作为生产力工具,不但要顺手而且更要顺眼。这样才能快乐编码,甚至降低 BUG 率。上次分享了一些 IDEA 有用的插件,反...

【相亲】96年程序员小哥第一次相亲,还没开始就结束了

颜值有点高,条件有点好

太厉害了,终于有人能把TCP/IP 协议讲的明明白白了

一图看完本文 一、 计算机网络体系结构分层 计算机网络体系结构分层 计算机网络体系结构分层 不难看出,TCP/IP 与 OSI 在分层模块上稍有区别。OSI 参考模型注重“通信协议必要的功能是什么”,而 TCP/IP 则更强调“在计算机上实现协议应该开发哪种程序”。 二、 TCP/IP 基础 1. TCP/IP 的具体含义 从字面意义上讲,有人可能会认为...

腾讯面试题: 百度搜索为什么那么快?

我还记得去年面腾讯时,面试官最后一个问题是:百度/google的搜索为什么那么快? 这个问题我懵了,我从来没想过,搜素引擎的原理是什么 然后我回答:百度爬取了各个网站的信息,然后进行排序,当输入关键词的时候进行文档比对……巴拉巴拉 面试官:这不是我想要的答案 我内心 这个问题我一直耿耿于怀,终于今天,我把他写出来,以后再问,我直接把这篇文章甩给他!!! 两个字:倒排,将贯穿整篇文章,也是面试官...

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问