[英]How can i assign a value of a variable from another variable?
我正在嘗試變量一 = 變量二; 這沒用。
代碼是葡萄牙語的,所以可能很難閱讀。
#include <stdio.h>
int main(void){
int ano, mes, dia;
int dm[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
printf("digite um ano: ");
scanf("%d", &ano);
if(ano %4==0 || ano %100 == 0 || ano %400 == 0){
ano=0;
}
else{
ano = 1;
}
printf("digite um mes: ");
scanf("%d", &mes);
mes = dm;
printf("%d", mes);
return 0;
}
你將一個數組賦值為一個整數! mes 是一個 integer (int) 並且 dm 是一個數組 (int[] -array of integer)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.