[완료] [Error] ld returned 1 exit status 가 떠서 질문 올립니다.

prosten의 이미지

#include<stdio.h>
#include<stdlib.h>
 
int main (void) {
	int grade; int kor;
	int math; int eng;
 
 
	printf("***개인 성적 입력 ***");
 
	printf("\t*학  번 :");
	scanf("&d" ,grade);
	printf("\n\t*국어:");
	scanf("&d",kor);
	printf("\n\t*수학:");
	scanf("%d",math);
	printf("\n\t*영어:");
	scanf("%d",eng); 
 
	printf("\t===>합계:%d+%d+%d",kor,math,eng,kor+math,eng);
	scanf("%if",kor+math+eng);
	If(kor+math+eng>=270);
	 {
	 printf("합격입니다."); 
	 }
	If(kor+math+eng<270);
	 {
	 return 0;
	 } 
 
	printf("/t/n%d님의 점수는 %d입니다.",grade,kor+math+eng);
	printf("============================================");
	printf("수고하였습니다.");
 
	system("pause");
 
	return 0;

이렇게 타이핑(?)을 하니까 제목과 같은 오류가 났습니다.
이걸 어떻게 해결해야 하나요?

또 이게 첨부 파일에서처럼 프로그램이 돌아가도록 해야 하는데 많이 틀린 것 같습니다.
첨부 파일처럼 실행시키려는 데 제가 안 한 부분 같은 게 있을까요?

답변 부탁드립니다.

File attachments: 
첨부파일 크기
Image icon 없음1.png3.45 KB
klyx의 이미지

컴파일할때 입력한 명령어와 전체 출력을 전부 올려주세요.

그리고 main함수가 끝이 없는데 마지막에 }가 누락된건가요?
틀린곳이 몇개 있긴 하지만 일단 문법적으로 컴파일이 안되는 부분은 그거만 보이네요.

prosten의 이미지

ㅇ....이게 전부에요 .... ㅠㅠ

익명 사용자의 이미지

scanf 시에 변수에 &를 넣어야 하지 않나요??
그리고
scanf("%if",kor+math+eng); 이부분에서 입력을 변수 세개를 합한거라는게 이상합니다.

Necromancer의 이미지

프로그램 문제가 아니라 라이브러리 제대로 설치 안된거 같은데요. 제목의 문장은 링크단계에서 라이브러리 없어서 나는 에러인데. 빨간모자나 그 클론(fedora, centos...) 쓰신다면 stdio 등등을 지원하는 glibc의 개발패키지가 따로 있으니 그거 까셔야 할겁니다. 기본설치하면 실행용 공유라이브러리만 깔려요.

Written By the Black Knight of Destruction

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.