I have an assignment to complete in c language -- 2

Ditutup Dipasang 4 tahun yang lalu Dibayar saat pengiriman
Ditutup Dibayar saat pengiriman

a person is standing on feld[0] and has to make it to the end(feld[20])

the rules are

either forward those many steps the box has value((*s).feld[x])

or backward whole number of the half of the value

at last it should either return 0 or 1

0 being cannot be solved

1 being can be solved

this is the c file

#include

#include

#include "testat-7.h"

int huepfspiel(spielfeld * s, int nr);

int huepfspiel(spielfeld * s, int nr){

int rc = 0;

static int aufrufe;

int k;

++aufrufe;

printf("%d", aufrufe);

if(nr == 20)

rc = 1;

if(nr != 20 && aufrufe < 4000){

for(k=0; k<=1; k++){

if(k == 1 && (nr + (*s).feld[nr] = 0)){

nr = (nr - (((*s).feld[nr])/2));

rc = huepfspiel(&s, nr);

if(rc == 1)

break;

}

}

// ...

}

return rc;

}

int main() {

spielfeld s = {20, {5,3,2,1,7,5,1,2,3,4,5,1,3,7,1,5,1,9,0,1}};

//printf("%d", [login to view URL][20]);

printf("Loesbar: %d\n", huepfspiel(&s, 0));

return 0;

}

-----------------------------------------------------------

and this is the header file

#ifndef _TESTAT_7_H

#define _TESTAT_7_H

typedef struct {

int n; // Feldgroesse

int feld[20]; // Spielfeld

} spielfeld;

#endif

Algoritma Pemrograman C Pemrograman C# Pemrograman C++ Perancangan Perangkat Lunak

ID Proyek: #23622566

Tentang proyek

9 proposal Proyek online Aktif 4 tahun yang lalu

9 freelancer rata-rata menawar ₹1094 untuk pekerjaan ini

idleswell

Hello, I have 30 years experience programming in C. You have posted some C code. What do you require from me? A milestone payment for the full budget for this project must be deposited with this site before your offe Lebih banyak

₹1200 INR dalam 7 hari
(185 Ulasan)
6.2
atul0x60

pm me. I solved it.

₹800 INR dalam 1 hari
(9 Ulasan)
2.9
ecofriendlygeek

Hello , I have made a solution based on the code you have uploaded. I can share with you if you award me the bid. Please discuss on chat. Thanks.

₹1500 INR dalam 1 hari
(1 Ulasan)
1.1
shbhmsxn4

I will work on the program, it seems pretty straightforward. I plan on using backtracking algorithm to find the solution. I have immense experience with c/c++.

₹1750 INR dalam 1 hari
(0 Ulasan)
0.0
Aqilkhan3032

Sir i am the student of me and engineering and i have studied C++ one of my subject i will complete your task in less timee please hire me

₹600 INR dalam 7 hari
(0 Ulasan)
0.0
harsh307shuklaaa

Solved this question however,I posses required skills and desire to work on this project which makes me different from crowd.I would love to be part of this project and use and enhance my skills.

₹1050 INR dalam 7 hari
(0 Ulasan)
0.0