עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

עזרה אם סקריפט בANSI C

Featured Replies

פורסם

אני בקורס תיכנות 1 וזו עבודה ראשונה שאני צריך להגיש אני כתבתי אותה ולא הרור לי למה היא לא עובדת :\

אשמח לקבל עזרה בעניין והרי הקוד:

#include <stdio.h>

void main(){

int k,i,ans,num,j,flag;
num= 0;
j= 0;
printf("dear mofo please enter a number greater than 1\n");
scanf("%d" ,&num);
flag = 0;

for (i=1; i<num ; i++){
ans= 0;
i=j;

while (num >ans) {
ans= ans + j;
j= j+1;
}
if (ans ==num){
flag = 1;
for (k = i; k == j-1; k++){
printf ("%d+" ,k );}
}
}
if(flag == 0 ){
printf("cannot find devidors of this fucker\n");
}
}

govner

נ.ב.

הנה החלינק לעבודה התוכנית לעיל היא השאלה הראשונה

http://bgu.uniclass.co.il/ee08/uploader.php?file=assignmet-1.pdf&id=5

פורסם

מה זאת אומרת "לא עובדת"? היא מתקמפלת? מה היא עושה?

חוץ מזה, תשתמש ב-int main במקום void main, ושים return 0 בסוף התוכנית.

עריכה: טוב, לא התעמקתי הרבה בתוכנית שלך, אבל בשורה שבה אתה עושה i=j, יכול להיות שהתכוונת j=i?

חוץ מזה, בלולאה שבה אתה מדפיס את התוצאות, התנאי צריך להיות k < j ולא k==j.

פורסם
  • מחבר

כן אתה צודק הבעיה הייתה I=J אצלי בראש שיוויון זה של משוואה :P לגביי הלולאה היות והתוכנית עובדת אני אשאיר את זה כך. תודה על העזרה

g0vner

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.