QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#269717#5304. Money GameCarpe_DiemCompile Error//C++20391b2023-11-29 21:55:382023-11-29 21:55:38

Judging History

你现在查看的是最新测评结果

  • [2023-11-29 21:55:38]
  • 评测
  • [2023-11-29 21:55:38]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

int n;

void solve(){
    scanf("%d",&n);
    ll sum=0;
    for(int i=1;i<=n;i++){
        int u;
        scanf("%lld",&u);
        sum+=u;
    }

    double ans=(double)sum/(n+1);

    printf("%.7lf ",ans*2);
    for(int i=1;i<n;i++)printf("%.7lf ",ans);printf("\n");
}

int main(){

    solve();
    

    return 0;
}

Details

answer.code: In function ‘void solve()’:
answer.code:8:5: error: ‘ll’ was not declared in this scope
    8 |     ll sum=0;
      |     ^~
answer.code:11:19: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘int*’ [-Wformat=]
   11 |         scanf("%lld",&u);
      |                ~~~^  ~~
      |                   |  |
      |                   |  int*
      |                   long long int*
      |                %d
answer.code:12:9: error: ‘sum’ was not declared in this scope
   12 |         sum+=u;
      |         ^~~
answer.code:15:24: error: ‘sum’ was not declared in this scope
   15 |     double ans=(double)sum/(n+1);
      |                        ^~~
answer.code:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
answer.code:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%lld",&u);
      |         ~~~~~^~~~~~~~~~~