結果
問題 | No.746 7の倍数 |
ユーザー |
![]() |
提出日時 | 2018-11-17 13:19:36 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 476 bytes |
コンパイル時間 | 119 ms |
コンパイル使用メモリ | 22,528 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 14:27:06 |
合計ジャッジ時間 | 912 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&N); | ~~~~~^~~~~~~~~ main.cpp:27:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 27 | scanf("%d", &N); | ~~~~~^~~~~~~~~~
ソースコード
#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>int main(void) {int N;scanf("%d",&N);if (N == 0) {printf("0");return 0;}else {printf("0.");}for (int n = 0; n < N / 6; n++) {printf("142857");}int i = N % 6;switch (i){case(5): printf("14285"); break;case(4): printf("1428"); break;case(3): printf("142"); break;case(2): printf("14"); break;case(1): printf("1"); break;case(0): break;}scanf("%d", &N);return 0;}