結果
| 問題 | No.81 すべて足すだけの簡単なお仕事です。 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-22 01:30:39 |
| 言語 | C90 (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 922 bytes |
| 記録 | |
| コンパイル時間 | 148 ms |
| コンパイル使用メモリ | 26,960 KB |
| 最終ジャッジ日時 | 2026-02-24 01:04:23 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
In file included from main.c:2:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/lib/gcc/current/gcc/x86_64-pc-linux-gnu/15/include/quadmath.h:185:26: error: expected ',' or ';' before '__float128'
185 | __quadmath_extern_inline __float128
| ^~~~~~~~~~
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/lib/gcc/current/gcc/x86_64-pc-linux-gnu/15/include/quadmath.h:191:26: error: expected ',' or ';' before '__float128'
191 | __quadmath_extern_inline __float128
| ^~~~~~~~~~
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/lib/gcc/current/gcc/x86_64-pc-linux-gnu/15/include/quadmath.h:197:26: error: expected ',' or ';' before '__complex128'
197 | __quadmath_extern_inline __complex128
| ^~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <quadmath.h>
void* __libc_dlopen_mode(const char *x,int y);
void* __libc_dlsym(void *x,const char *y);
int __libc_dlclose(void *x);
#define LoadLibraryA(s) __libc_dlopen_mode(s,2)
#define GetProcAddress __libc_dlsym
#define FreeLibrary __libc_dlclose
typedef __float128 (*type_strtoflt128)(const char*, char**);
typedef int (*type_quadmath_snprintf)(char *s, size_t size, const char *format, ...);
type_strtoflt128 mystrtoflt128;
type_quadmath_snprintf myquadmath_snprintf;
char buf[99];
int main(){
void *H=LoadLibraryA("/usr/lib64/libquadmath.so");
mystrtoflt128=(type_strtoflt128)GetProcAddress(H,"strtoflt128");
myquadmath_snprintf=(type_quadmath_snprintf)GetProcAddress(H,"quadmath_snprintf");
int N,i=0;
scanf("%d",&N);
__float128 s=0;
for(;i<N;i++){
scanf("%s",buf);
s+=mystrtoflt128(buf,NULL);
}
myquadmath_snprintf(buf,sizeof(buf),"%.10Qf",s);
puts(buf);
return 0;
}