結果
問題 | No.501 穴と文字列 |
ユーザー |
![]() |
提出日時 | 2017-04-08 23:40:30 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 103 ms |
コンパイル使用メモリ | 22,784 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 16:30:51 |
合計ジャッジ時間 | 831 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d %d",&n,&d); | ^~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <math.h>#include <stdlib.h>int main(void){int n,d;scanf("%d %d",&n,&d);int i;if(d<=n){for(i=0;i<d;i++){printf("A");}for(i=0;i<n-d;i++){printf("C");}}else{int c=d-n;for(i=0;i<n-c;i++){printf("A");}for(i=0;i<c;i++){printf("B");}}printf("\n");return 0;}