//【日期】黑色星期五

#include "stdio.h"

#include

#include "math.h"
extern int a;
int fa(int b) //判断为星期几的函数，返回值x

{int c=13,x,y=0;

``````        if(b>12||b<1){
printf("month is error.\n"); goto out;  }
if(a<=1900){
printf("year is error.\n"); goto out;   }
if(((b==1||b==3||b==5||b==7||b==8||b==10||b==12)&&c>31)||(((a%4==0&&a%100!=0)||(a%400==0))&&b==2&&c>29)||((a%4!=0||a%100==0)&&c>28)||((b==6||b==4||b==9||b==11)&&c>31)||(c<1)){
printf("day is error.\n");  goto out; }
switch(b)
{   case 1:x=c%7+1;break;
case 2:x=(31+c)%7+1;break;
case 3:x=(31+28+c)%7+1;break;
case 4:x=(31+28+31+c)%7+1;break;
case 5:x=(31+28+31+30+c)%7+1;break;
case 6:x=(31+28+31+30+31+c)%7+1;break;
case 7:x=(31+28+31+30+31+30+c)%7+1;break;
case 8:x=(31+28+31+30+31+30+31+c)%7+1;break;
case 9:x=(31+28+31+30+31+30+31+31+c)%7+1;break;
case 10:x=(31+28+31+30+31+30+31+31+30+c)%7+1;break;
case 11:x=(31+28+31+30+31+30+31+31+30+31+c)%7+1;break;
case 12:x=(31+28+31+30+31+30+31+31+30+31+30+c)%7+1;break;
}
if(a>2013)x+=(a-2013)/4+(a-2013);
if(a<2013)   {
x-=(2016-a)/4+(2013-a)-7;
x+=7*((2015-x)/7);
}

if(x>=7)x=x%7;
out:
return x;
}

//主函数判断某一年的13号是不是为星期五
int main()
{
int  fa(int b) ;
int i=0,j,b,s;

scanf("%d",&a);
for(b=1;b<13;b++){
if(fa(b)==5){
j[i]=b;
i++;
}
}
s=i;
printf("There are %d Black Fridays in year %d.\n",i,a);
printf("They are:\n");

for(i=0;i<s;i++){
printf("%d/%d/13\n",a,j[i]);
}

}
``````
``````
``````

1个回答

`extern int a;`这一句，换成`int a;`就行了。 # 首先说明，不是编译器没有关闭的问题。 附代码供大佬检查。 ``` #include <iostream> using namespace std ; void merges(double [] , int , double [] , int , double []) ; int main() { double numbers1 , numbers2 , numbers ; int count = 0 ; for (int i = 0 ; i <= count ; i++) { if (count == 0) { cout << "输入第一个数组的元素个数\n" ; cin >> count ; count = count - 1 ; cout << "依次输入第一个数组的元素\n" ; } cin >> numbers1[i] ; } int numbers1Size = count + 1 ; count = 0 ; for (int i = 0 ; i <= count ; i++) { if (count == 0) { cout << "输入第二个数组的元素个数\n" ; cin >> count ; count = count - 1 ; cout << "依次输入第二组数组元素\n" ; } cin >> numbers2[i] ; } int numbers2Size = count + 1 ; merges(numbers1 , numbers1Size , numbers2 , numbers2Size , numbers) ; return 0 ; } void merges(double numbers1 , int numbers1Size , double numbers2 , int numbers2Size , int numbers) { bool changed ; do { changed = false ; for (int i = 0 ; i < numbers1Size - 1 ; i++) { if(numbers1[i] > numbers1[i+1]) { double savings ; savings = numbers1[i] ; numbers1[i] = numbers1[i+1] ; numbers1[i+1] = savings ; changed = true ; } } }while (changed) ; do { changed = false ; for (int i = 0 ; i < numbers2Size - 1 ; i++) { if(numbers2[i] > numbers2[i+1]) { double savings ; savings = numbers2[i] ; numbers2[i] = numbers2[i+1] ; numbers2[i+1] = savings ; changed = true ; } } }while (changed) ; int n1 = 0 , n2 = 0; for (int i = 0 ; i <= numbers1Size + numbers2Size -1 ; i++) { if (n1 <= numbers1Size - 1 && n2 <= numbers2Size - 1) { if (numbers1[n1] > numbers2[n2]) { numbers[i] = numbers2[n2] ; n2++ ; } else { numbers[i] = numbers1[n1] ; n1++ ; } continue ; } if (n1 > numbers1Size - 1) { for ( ; n2 <= numbers2Size - 1 ; n2++) { numbers[i] = numbers2[n2] ; i++ ; } continue ; } if (n2 > numbers2Size - 1) { for ( ; n1 <= numbers1Size - 1 ; n1++) { numbers[i] = numbers1[n1] ; i++ ; } } } cout << "\n\n" << "将两个数组合并后的元素按大小顺序排列如下: " ; for (int j = 0 ; j <= (numbers1Size + numbers2Size - 1) ; j++) { cout << numbers[j] << " " ; } return ; } ``` ## 求大佬解答！！

ubuntu 平台 codeblocks 编译多文件项目时出现error: ld returned 1 exit status 的问题

/*******a.h*******/ #ifndef A_H_INCLUDE #define A_H_INCLUDE void test(); #endif /***********a.cpp***********/ #include <iostream> #include "a.h" using namespace std; void test(){ cout<<"hello"<<endl; } /*********main.cpp************/ #include "a.h" int main() { test(); return 0; } 用codeblocks 编译的时候怎么都无法编译过。一直提示error:ld returned 1 exit status.

Eclipse下编译通过后，再编提示error: ld returned 1 exit status

RT Eclipse for C++ 每次都是这样，好像是因为编译出的exe运行直接未响应导致的。 按照提示，好像我编译的exe文件还在运行，所以无法编译

[Error] ld returned 1 exit status在Dev的运行的程序是错了什么啊？

#include <iostream> using namespace std; class Rectangle { public: Rectangle(int x,int y); int area(); private: int width;int length; }; int Rectangle::area() { return width*length; } int main() { int width; int length; cout<<"enter the width and length of the rectangle:"<<endl; cin>>width>>length; Rectangle A(width,length); cout<<"the area of rectangle a is"<<A.area()<<endl; return 0; }

collect2.exe: error: ld returned 1 exit status

C++[Error] ld returned 1 exit status

#include<iostream> #include<cmath> using namespace std; class Point { private: int x,y; public: void yidondian(); void xianshijuli(); }; class Line { private: int x,y; public: void diandaozhixianjuli(); void xielvguanxi(); }; class Friangle { private: int x1,x2,x3,y1,y2,y3; public: void panduansanjiaoxing(); void jisuanmianji(); }; void Point::yidondian() { cout<<"输入移动点的坐标"<<endl; cin>>x>>y; cout<<"移动点的坐标为:"<<"("<<x<<","<<y<<")"; } void Point::xianshijuli() { int d; d=sqrt(x*x+y+y); cout<<"点到原点的距离为:"<<endl; } void Line::diandaozhixianjuli() { int a,b,c,d1,d2,d; cout<<"输入点的坐标"<<endl; cin>>x>>y; cout<<"输入直线ax±by+c=0的三个参数abc"<<endl; cin>>a>>b>>c; d1=x*a+b*y+c; d2=sqrt(a*a+b*b); d=d1/d2; if(d>0) { cout<<"点到直线的距离为:"<<d<<endl; } else if(d<0) { int d3; d3=-d; cout<<"点到直线的距离为:"<<d3<<endl; int k; k=-(a/b); if(b!=0) { cout<<"斜率为:"<<k<<endl; } else cout<<"斜率不存在"; } } void Line::xielvguanxi() { int a1,b1,c1,a2,b2,c2,w1,w2,w3; cout<<"输入直线L1 a1x±b1y+c1=0的三个参数a1b1c1"<<endl; cin>>a1>>b1>>c1; cout<<"输入直线L2 a2x±b2y+c2=0的三个参数a2b2c2"<<endl; cin>>a2>>b2>>c2; w1=a1*a2+b1*b2; w2=a1/a2; w3=b1/b2; if(w1==0) { cout<<"两直线互相垂直"; } else if((w2==w3)&&(w3!=c1/c2)) { cout<<"两直线平行"; } else if((w1==w2)&&(w2==w3)) { cout<<"两直线重合"; } else cout<<"两直线相交且不垂直"; } void Friangle::panduansanjiaoxing() { int x1,y1,x2,y2,x3,y3,d1,d2,d3,s1,s2,s3; cout<<"依次输入三个点的坐标"<<endl; cin>>x1>>y1; cin>>x2>>y2; cin>>x3>>y3; d1=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); d2=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3)); d3=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2)); s1=sqrt(d1*d1+d2*d2); s2=sqrt(d1*d1+d3*d3); s3=sqrt(d2*d2+d3*d3); if(((d1+d2)>d3)&&((d1+d3)>d2)&&((d2+d3)>d1)) { cout<<"能构成三角形"<<endl; if((d1==d2)&&(d2==d3)) { cout<<"此三角形是等边三角形"<<endl; } if(d1==d2||d1==d3||d2==d3) { cout<<"此三角形是等腰三角形"<<endl; } if(s1==d3||s2==d2||s3==d1) { cout<<"此三角形是直角三角形"<<endl; } double p; p=(d1+d2+d3)/2; double s; s=sqrt(p*(p-d1)*(p-d2)*(p-d3)); cout<<"三角形的面积为:"<<s<<endl; } else { cout<<"不能构成三角形"<<endl; } } void menu() { cout<<"=============================="<<endl; cout<<" 菜单 "<<endl; cout<<" Point的功能按<1> "<<endl; cout<<" Line的功能按<2> "<<endl; cout<<" Friangle的功能按<3> "<<endl; cout<<" PolyAngle的功能按<4> "<<endl; cout<<" 退出按<0> "<<endl; cout<<"=============================="<<endl; } void hanshu1() { Point point1; point1.yidondian(); point1.xianshijuli(); } void hanshu2() { Line line1; line1.diandaozhixianjuli(); line1.xielvguanxi(); } void hanshu3() { Friangle friangle1; friangle1.panduansanjiaoxing(); friangle1.jisuanmianji(); } int main() { int i; while(1) { cin>>i; menu(); switch(i) { case 1: hanshu1(); break; case 2: hanshu2(); break; case 3: hanshu3(); break; case 0: exit(0); } } return 0; } 一直有这个问题运行不了。运行了又没有内容？

Ubuntu codeblocks 编译出现 error:id returned 1 exit status?

```c++ #include<iostream> #include<unistd.h> #include<thread> #include<mutex> using namespace std; void execute(mutex &m,char &i,char t) { for(;true;m.lock(),cout<<"线程"<<t<<"执行中，输入:",cin>>i,cout<<"线程"<<t<<"执行",i==t?cout<<"成功":cout<<"失败",cout<<"。"<<endl,m.unlock(),sleep(1)); } int main(int argc,char *argv[]) { mutex m; char i; thread t([&m,&i]() { execute(m,i,'t'); }),u([&m,&i]() { execute(m,i,'u'); }),v([&m,&i]() { execute(m,i,'v'); }); t.join(); u.join(); v.join(); return 0; } ```

//此函数找出数组最小值 #include <stdio.h> int minvalue ( int value ) { int minValue , i; minValue = value; for ( i = 1; i<10 ; i++){ if( value[i]<minValue ) minValue = value[i]; } return minValue; } //此函数为主程序 int mian() { printf ("输入十个数字\n"); int value; int i; int minvalue ( int value ); for (i = 0; i<10; i++) value[i] = 0; scanf ("%i", &value[i]); int minscores; minscores = minvalue ( value ); //将一个数组传递给一个函数，只需在调用时列出函数的名字，不需带任何下标。 printf("最小值为%d\n",minscores); return 0; } 求大神解答

C##初学者 求大神帮忙解决一下Id returned 1exid status

g++编译出现错误，求解答

linux内核编译报错，求指点？

vcs 仿真 生成simv文件 的错误

vcs 仿真 生成simv文件时，有一句g++ -o ../simv .... -lswift 路径这是什么意思啊？ 我现在的问题是 /usr/bin/ld:cannot find -lswift collect2: ld returned 1exit status make *** [procduct_timestamp]Error1 Make exited with status 2 希望大神解答一下

ubuntu14 下 Caffe编译问题 出错

# .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardData_v3'.build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardData_v3' .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardFilter_v3' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/upgrade_solver_proto_text.bin] Error 1 make: *** Waiting for unfinished jobs.... .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardData_v3' .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardFilter_v3' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/upgrade_net_proto_binary.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardData_v3' .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardFilter_v3' collect2: error: ld returned 1 exit status .build_release/lib/make: libcaffe.so: undefined reference to *** [.build_release/tools/compute_image_mean.bin] Error 1`cudnnConvolutionBackwardData_v3 ' .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardFilter_v3' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/caffe.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardData_v3' .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardFilter_v3' collect2: error: ld returned 1 exit status make: *** [.build_release/examples/cifar10/convert_cifar_data.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardData_v3' .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardFilter_v3' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/convert_imageset.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardData_v3' .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardFilter_v3' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/extract_features.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardData_v3' .build_release/lib/libcaffe.so: undefined reference to `cudnnConvolutionBackwardFilter_v3' collect2: error: ld returned 1 exit status make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1_**

Linux服务器上编译报错

makefile 编译文件的时候提示这个错误,试过网上很多方法，还是报错，在线等

/usr/bin/ld: zdatabase.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status makefile:23: recipe for target 'hello' failed make: *** [hello] Error 1

Java 最常见的 200+ 面试题：面试必备

winfrom中嵌套html，跟html的交互

winfrom中嵌套html，跟html的交互,源码就在里面一看就懂，很简单

HoloLens2开发入门教程

MFC一站式终极全套课程包

Python可以这样学（第一季：Python内功修炼）

Vue.js 2.0之全家桶系列视频课程

150讲轻松搞定Python网络爬虫

【为什么学爬虫？】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易，但是深入较难，如何写出高效率的爬虫，如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中，经常容易遇到被反爬虫，比如字体反爬、IP识别、验证码等，如何层层攻克难点拿到想要的数据，这门课程，你都能学到！ &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者，比如app开发，web开发，学习爬虫能让你加强对技术的认知，能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序，无论大小，总体来说可以分成三个步骤，分别是： 网络请求：模拟浏览器的行为从网上抓取数据。 数据解析：将请求下来的数据进行过滤，提取我们想要的数据。 数据存储：将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解，带领学生完整的掌握每个步骤的技术。另外，因为爬虫的多样性，在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性，分别是： 爬虫进阶：包括IP代理，多线程爬虫，图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫：Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站，而Scrapy框架作为一个专业的爬虫框架，使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求，我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫，本套课程满足您的所有需求！ 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

SEIR课程设计源码与相关城市数据.rar

SEIR结合学报与之前博客结合所做的一些改进，选择其中三个城市进行拟合仿真SEIR结合学报与之前博客结合所做的一些改进，选择其中三个城市进行拟合仿真SEIR结合学报与之前博客结合所做的一些改进，选择其

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程，课程主要以真实数据为基础，详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用，并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题，为进一步深入学习数据挖掘打下扎实的基础。

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼，如今蓄势待发：2019年9月6-7日，大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京，进行技术解读和产业论证。我们不空谈口号，只谈技术，诚挚邀请AI业内人士一起共铸人工智能新篇章！

Java面试题大全（2020版）

GIS程序设计教程 基于ArcGIS Engine的C#开发实例

[透视java——反编译、修补和逆向工程技术]源代码
{"ft_lang_label":"__label__zh","ft_lang_prob":0.51935494,"math_prob":0.94879097,"size":22584,"snap":"2020-24-2020-29","text_gpt3_token_len":12188,"char_repetition_ratio":0.13542959,"word_repetition_ratio":0.14805825,"special_character_ratio":0.32359192,"punctuation_ratio":0.21801408,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9539014,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-07-11T18:44:33Z\",\"WARC-Record-ID\":\"<urn:uuid:1b003dc9-e0fe-46b1-a18c-17acdb5f99bb>\",\"Content-Length\":\"132520\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6929ef8b-7478-46c6-a42b-eaf68fe46a46>\",\"WARC-Concurrent-To\":\"<urn:uuid:88190e90-095b-4e0d-b260-8091b35dfd4f>\",\"WARC-IP-Address\":\"47.95.50.136\",\"WARC-Target-URI\":\"https://ask.csdn.net/questions/994018?sort=votes_count\",\"WARC-Payload-Digest\":\"sha1:FRYPCR5IO5FSKHO5NRWODZXRSRGZB3CA\",\"WARC-Block-Digest\":\"sha1:2QSKC7ZFMXCXQXEMMFZOIPZJGH3QAUI6\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-29/CC-MAIN-2020-29_segments_1593655934052.75_warc_CC-MAIN-20200711161442-20200711191442-00451.warc.gz\"}"}