-5

I'm pretty sure this is standard but im very stuck as to why my C code wont compile. I'm a newb trying an array challenge:

#include <stdio.h>

int main(){
    int num;
    scanf("%d", &num);                                    // Reading input from STDIN
    printf("Input number is %d.\n", num);       // Writing output to STDOUT
} 
t - int {raw_input()}
while t !=0:
arr = []
n = int in range (n):
    arr.append (map(int, raw_input)).split()))
count = 0
    for i in range (n):
        for j in range (n):
            for v in range (i,n):
            if arr[i][j]> arr [v][k]:
            count +=1
print cout
t -=1

error:

8:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token


9:1: error: expected identifier or '(' before 
Marcus Müller
  • 34,677
  • 4
  • 53
  • 94

1 Answers1

1

You can't have C code outside of functions – only declarations would be possible where you start writing t - int…

The rest of your code after the closing } of main is not C at all. It's Python, so you're not even blindly copying C code without understanding it - you're copying Python.

so,

… my C code…

Not even similar to C code. Learn C if you want to learn C, or learn Python if you want to learn Python!

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • its a very confusing site! just trying to hack away, thanks! – user9570139 Jul 07 '22 at 13:47
  • no, it's not confusing. C is simply not Python. What you're asking is "why does my English teacher say the following sentence is grammatically wrong: "My name is user9570139 and I like to rückwärts im Sand laufen und dabei ein leckeres Bier trinken." – Marcus Müller Jul 07 '22 at 13:55
  • no im referrring to the site im working from, thanks for that very productive. i see your point however. – user9570139 Jul 07 '22 at 21:14
  • I mean what has you copying python code into C code to do with the site you're working on being confusing? – Marcus Müller Jul 08 '22 at 11:40